Package org.codehaus.plexus.interpolation

Examples of org.codehaus.plexus.interpolation.Interpolator.interpolate()


            {
                String key = (String) it.next();
                String value = props.getProperty( key );
                try
                {
                    value = interpolator.interpolate( value, "" );
                }
                catch ( InterpolationException e )
                {
                    throw new MojoExecutionException( "Failed to interpolate invoker properties: " + propertiesFile,
                                                      e );
View Full Code Here


                values.setProperty( "version", releaseVersion );
                interpolator.addValueSource( new PrefixedPropertiesValueSource( possiblePrefixes, values, true ) );
                RecursionInterceptor recursionInterceptor = new PrefixAwareRecursionInterceptor( possiblePrefixes );
                try
                {
                    defaultTag = interpolator.interpolate( scmTagNameFormat, recursionInterceptor );
                }
                catch ( InterpolationException e )
                {
                    throw new ReleaseExecutionException(
                        "Could not interpolate specified tag name format: " + scmTagNameFormat, e );
View Full Code Here

            for ( String key : (Set<String>) ( (Map) props ).keySet() )
            {
                String value = props.getProperty( key );
                try
                {
                    value = interpolator.interpolate( value, "" );
                }
                catch ( InterpolationException e )
                {
                    throw new MojoExecutionException( "Failed to interpolate invoker properties: " + propertiesFile, e );
                }
View Full Code Here

            for ( String key : (Set<String>) ( (Map) props ).keySet() )
            {
                String value = props.getProperty( key );
                try
                {
                    value = interpolator.interpolate( value, "" );
                }
                catch ( InterpolationException e )
                {
                    throw new MojoExecutionException( "Failed to interpolate invoker properties: " + propertiesFile,
                                                      e );
View Full Code Here

            values.setProperty("groupId", project.getGroupId());
            values.setProperty("version", latest.toString());
            interpolator.addValueSource(new PrefixedPropertiesValueSource(possiblePrefixes, values, true));
            RecursionInterceptor recursionInterceptor = new PrefixAwareRecursionInterceptor(possiblePrefixes);
            try {
                startTag = interpolator.interpolate(tagNameFormat, recursionInterceptor);
            } catch (InterpolationException e) {
                throw new MojoExecutionException("Could not interpolate specified tag name format: " + tagNameFormat,
                        e);
            }
        }
View Full Code Here

            values.setProperty("groupId", project.getGroupId());
            values.setProperty("version", project.getVersion());
            interpolator.addValueSource(new PrefixedPropertiesValueSource(possiblePrefixes, values, true));
            RecursionInterceptor recursionInterceptor = new PrefixAwareRecursionInterceptor(possiblePrefixes);
            try {
                endTag = interpolator.interpolate(tagNameFormat, recursionInterceptor);
            } catch (InterpolationException e) {
                throw new MojoExecutionException("Could not interpolate specified tag name format: " + tagNameFormat,
                        e);
            }
        }
View Full Code Here

  @Test
  public void testInterpolation_withoutSource() throws Exception {
    String s = "Hello ${name}";
   
    Interpolator i = new RegexBasedInterpolator();
    Assert.assertEquals("Hello ${name}", i.interpolate(s));
  }
 
  @Test
  public void testInterpolation_withPropertiesSource() throws Exception {
    String s = "Hello ${name}";
View Full Code Here

    props.put("name", "World");
    ValueSource vs = new PropertiesBasedValueSource(props);
   
    Interpolator i = new RegexBasedInterpolator();
    i.addValueSource(vs);
    Assert.assertEquals("Hello World", i.interpolate(s));
  }
 
  @Test
  public void testInterpolation_withCustomValueSource() throws Exception {
    String s = "Hello ${name}";
View Full Code Here

      }
    };
   
    Interpolator i = new RegexBasedInterpolator();
    i.addValueSource(vs);
    Assert.assertEquals("Hello World", i.interpolate(s));
  }
}
View Full Code Here

            values.setProperty("groupId", project.getGroupId());
            values.setProperty("version", previousVersion);
            interpolator.addValueSource(new PrefixedPropertiesValueSource(possiblePrefixes, values, true));
            RecursionInterceptor recursionInterceptor = new PrefixAwareRecursionInterceptor(possiblePrefixes);
            try {
                startTag = interpolator.interpolate(tagNameFormat, recursionInterceptor);
            } catch (InterpolationException e) {
                throw new MojoExecutionException("Could not interpolate specified tag name format: " + tagNameFormat,
                        e);
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.