Created
August 20, 2012 14:29
-
-
Save opyate/3404715 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java | |
=================================================================== | |
--- archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java (revision 1374285) | |
+++ archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java (working copy) | |
@@ -36,7 +36,7 @@ | |
import org.apache.maven.archetype.metadata.FileSet; | |
import org.apache.maven.archetype.metadata.ModuleDescriptor; | |
import org.apache.maven.archetype.metadata.RequiredProperty; | |
-import org.apache.velocity.VelocityContext; | |
+import org.apache.velocity.tools.ToolManager; | |
import org.apache.velocity.app.Velocity; | |
import org.apache.velocity.context.Context; | |
import org.codehaus.plexus.component.annotations.Component; | |
@@ -436,7 +436,8 @@ | |
private Context prepareVelocityContext( ArchetypeGenerationRequest request ) | |
{ | |
- Context context = new VelocityContext(); | |
+ ToolManager toolManager = new ToolManager( true ); | |
+ Context context = toolManager.createContext(); | |
context.put( Constants.GROUP_ID, request.getGroupId() ); | |
context.put( Constants.ARTIFACT_ID, request.getArtifactId() ); | |
context.put( Constants.VERSION, request.getVersion() ); | |
Index: archetype-common/pom.xml | |
=================================================================== | |
--- archetype-common/pom.xml (revision 1374285) | |
+++ archetype-common/pom.xml (working copy) | |
@@ -107,6 +107,11 @@ | |
<artifactId>velocity</artifactId> | |
</dependency> | |
<dependency> | |
+ <groupId>org.apache.velocity</groupId> | |
+ <artifactId>velocity-tools</artifactId> | |
+ <version>2.0</version> | |
+ </dependency> | |
+ <dependency> | |
<groupId>junit</groupId> | |
<artifactId>junit</artifactId> | |
<scope>test</scope> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment