interpolator.addValueSource( new EnvarBasedValueSource() );
interpolator.addValueSource( new EnvarBasedValueSource() );
try interpolator.addValueSource( new EnvarBasedValueSource() );
try interpolator.addValueSource( new EnvarBasedValueSource() );
@Nonnull private String interpolate(@Nonnull final String str) throws IOException, InterpolationException { Interpolator interpolator = new StringSearchInterpolator(); interpolator.addValueSource(new MapBasedValueSource(this.getProject().getProperties())); interpolator.addValueSource(new MapBasedValueSource(System.getProperties())); interpolator.addValueSource(new EnvarBasedValueSource()); return interpolator.interpolate(str); }
private void interpolate() throws Exception { Interpolator interpolator = new StringSearchInterpolator(); interpolator.addValueSource(new MapBasedValueSource(properties)); interpolator.addValueSource(new MapBasedValueSource(System.getProperties())); interpolator.addValueSource(new EnvarBasedValueSource()); for (Entry<String, String> entry : properties.entrySet()) { properties.put(entry.getKey(), interpolator.interpolate(entry.getValue())); } }
private void interpolate() throws Exception { Interpolator interpolator = new StringSearchInterpolator(); interpolator.addValueSource(new MapBasedValueSource(properties)); interpolator.addValueSource(new MapBasedValueSource(System.getProperties())); interpolator.addValueSource(new EnvarBasedValueSource()); for (Entry<String, String> entry : properties.entrySet()) { properties.put(entry.getKey(), interpolator.interpolate(entry.getValue())); } }
MavenXpp3Reader reader = new MavenXpp3Reader(); Model pomModel = reader.read(new FileReader(pomLibFile)); final List<Dependency> dependencies= pomModel.getDependencies(); final List<String> modules= pomModel.getModules(); final List<Profile> profiles = pomModel.getProfiles(); InputStream inputStream = new FileInputStream(new File(pomLibFile)); StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, "utf-8"); pomModel.getDependencyManagement(); final Properties properties = new Properties(); properties.load(new FileInputStream(pomProperties)); RegexBasedInterpolator interpolator = new RegexBasedInterpolator(); interpolator.addValueSource( new EnvarBasedValueSource() ); interpolator.addValueSource( new PropertiesBasedValueSource( properties ) ); List<String> synonymPrefixes = new ArrayList<String>(); synonymPrefixes.add( "project." ); synonymPrefixes.add( "pom." ); PrefixedValueSourceWrapper modelWrapper = new PrefixedValueSourceWrapper( new ObjectBasedValueSource( pomModel ),synonymPrefixes, true ); interpolator.addValueSource( modelWrapper ); PrefixedValueSourceWrapper pomPropertyWrapper = new PrefixedValueSourceWrapper( new PropertiesBasedValueSource( pomModel.getProperties() ), synonymPrefixes, true ); interpolator.addValueSource( pomPropertyWrapper ); interpolator.addValueSource( new PropertiesBasedValueSource( properties ) ); RecursionInterceptor recursionInterceptor = new PrefixAwareRecursionInterceptor( synonymPrefixes, true ); String serializedPOM = interpolator.interpolate( writer.toString(), recursionInterceptor ); System.out.println("-------- "+serializedPOM);;
interpolator.addValueSource( new EnvarBasedValueSource() );
interpolator.addValueSource( new EnvarBasedValueSource() );
interpolator.addValueSource( new EnvarBasedValueSource() );
interpolator.addValueSource( new EnvarBasedValueSource() );
interpolator.addValueSource( new EnvarBasedValueSource() );
try interpolator.addValueSource( new EnvarBasedValueSource() );