rename method and parameters for clarity
diff --git a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/generation/DefaultArchetypeGenerationConfigurator.java b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/generation/DefaultArchetypeGenerationConfigurator.java
index c02d332..2ffd451 100644
--- a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/generation/DefaultArchetypeGenerationConfigurator.java
+++ b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/generation/DefaultArchetypeGenerationConfigurator.java
@@ -213,7 +213,7 @@
defaultValue = archetypeConfiguration.getProperty( Constants.GROUP_ID );
}
value = archetypeGenerationQueryer.getPropertyValue( requiredProperty,
- getTransitiveDefaultValue( defaultValue, requiredProperty, context ),
+ expandEmbeddedTemplateExpressions( defaultValue, requiredProperty, context ),
archetypeConfiguration.getPropertyValidationRegex( requiredProperty ) );
}
@@ -257,7 +257,7 @@
if ( defaultValue != null )
{
- String value = getTransitiveDefaultValue( defaultValue, requiredProperty, context );
+ String value = expandEmbeddedTemplateExpressions( defaultValue, requiredProperty, context );
archetypeConfiguration.setProperty( requiredProperty, value );
context.put( requiredProperty, value );
}
@@ -308,14 +308,14 @@
request.setProperties( properties );
}
- private String getTransitiveDefaultValue( String defaultValue, String requiredProperty, Context context )
+ private static String expandEmbeddedTemplateExpressions( String originalText, String textDescription, Context context )
{
- if ( StringUtils.contains( defaultValue, "${" ) )
+ if ( StringUtils.contains( originalText, "${" ) )
{
- try ( StringWriter stringWriter = new StringWriter() )
+ try ( StringWriter target = new StringWriter() )
{
- Velocity.evaluate( context, stringWriter, requiredProperty, defaultValue );
- return stringWriter.toString();
+ Velocity.evaluate( context, target, textDescription, originalText );
+ return target.toString();
}
catch ( IOException ex )
{
@@ -323,7 +323,7 @@
throw new RuntimeException( "Exception closing StringWriter", ex );
}
}
- return defaultValue;
+ return originalText;
}
private void restoreCommandLineProperties( ArchetypeConfiguration archetypeConfiguration,