/** * Serialize the inbound Model instance to a StringWriter, perform the regex replacement to resolve * POM expressions, then re-parse into the resolved Model instance. * <br/> * <b>NOTE:</b> This will result in a different instance of Model being returned!!! * * @param model The inbound Model instance, to serialize and reference for expression resolution * @param context The other context map to be used during resolution * @return The resolved instance of the inbound Model. This is a different instance! * * @deprecated Use {@link ModelInterpolator#interpolate(Model, File, ProjectBuilderConfiguration, boolean)} instead. */ public Model interpolate( Model model, Map<String, ?> context, boolean strict ) throws ModelInterpolationException { Properties props = new Properties(); props.putAll( context ); return interpolate( model, null, new DefaultProjectBuilderConfiguration().setExecutionProperties( props ), true ); }
/** * Serialize the inbound Model instance to a StringWriter, perform the regex replacement to resolve * POM expressions, then re-parse into the resolved Model instance. * <p> * <b>NOTE:</b> This will result in a different instance of Model being returned!!! * * @param model The inbound Model instance, to serialize and reference for expression resolution * @param context The other context map to be used during resolution * * @return The resolved instance of the inbound Model. This is a different instance! * * @deprecated Use {@link ModelInterpolator#interpolate(Model, File, ProjectBuilderConfiguration, boolean)} instead. */ public Model interpolate( Model model, Map<String, ?> context, boolean strict ) throws ModelInterpolationException { Properties props = new Properties(); props.putAll( context ); return interpolate( model, null, new DefaultProjectBuilderConfiguration().setExecutionProperties( props ), true ); }
/** * creates model lineage for the given pom file. * Useful to be able to locate where certain elements are defined. * * @param pom * @param embedder * @param allowStubs * @return */ public static ModelLineage createModelLineage(File pom, MavenEmbedder embedder, boolean allowStubs) throws ProjectBuildingException { try { ModelLineageBuilder bldr = (ModelLineageBuilder) embedder.getPlexusContainer().lookup(ModelLineageBuilder.class); ProfileActivationContext context = new DefaultProfileActivationContext(new Properties(), true); //TODO shall we pass some execution props in here? ProfileManager manager = new DefaultProfileManager(embedder.getPlexusContainer(), context); DefaultProjectBuilderConfiguration conf = new DefaultProjectBuilderConfiguration(); conf.setGlobalProfileManager(manager); conf.setExecutionProperties(new Properties()); conf.setLocalRepository(embedder.getLocalRepository()); conf.setUserProperties(new Properties()); return bldr.buildModelLineage(pom, conf, new ArrayList(), allowStubs, true); } catch (ComponentLookupException ex) { Exceptions.printStackTrace(ex); } return new DefaultModelLineage(); }
/** * creates model lineage for the given pom file. * Useful to be able to locate where certain elements are defined. * * @param pom * @param embedder * @param allowStubs * @return */ public static ModelLineage createModelLineage(File pom, MavenEmbedder embedder, boolean allowStubs) throws ProjectBuildingException { try { ModelLineageBuilder bldr = (ModelLineageBuilder) embedder.getPlexusContainer().lookup(ModelLineageBuilder.class); ProfileActivationContext context = new DefaultProfileActivationContext(new Properties(), true); //TODO shall we pass some execution props in here? ProfileManager manager = new DefaultProfileManager(embedder.getPlexusContainer(), context); DefaultProjectBuilderConfiguration conf = new DefaultProjectBuilderConfiguration(); conf.setGlobalProfileManager(manager); conf.setExecutionProperties(new Properties()); conf.setLocalRepository(embedder.getLocalRepository()); conf.setUserProperties(new Properties()); return bldr.buildModelLineage(pom, conf, new ArrayList(), allowStubs, true); } catch (ComponentLookupException ex) { Exceptions.printStackTrace(ex); } return new DefaultModelLineage(); }
new DefaultProjectBuilderConfiguration().setExecutionProperties( getProject().getProperties() ), false );
new DefaultProjectBuilderConfiguration().setExecutionProperties( getProject().getProperties() ), false );
new DefaultProjectBuilderConfiguration().setExecutionProperties( getProject().getProperties() ), true );
new DefaultProjectBuilderConfiguration().setExecutionProperties( getProject().getProperties() ), true );