Repository: maven-archetype Updated Branches: refs/heads/master d9566b03a -> e9078f97b
Add ArchetypeGenerationRequest in the context of the groovy script. Add the ArchetypeGenerationRequest in the context of the groovy script, so that we can get the outputDirectory and other useful information when executing the groovy script during archetype generation. Related to https://issues.apache.org/jira/browse/ARCHETYPE-494 Project: http://git-wip-us.apache.org/repos/asf/maven-archetype/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-archetype/commit/e9078f97 Tree: http://git-wip-us.apache.org/repos/asf/maven-archetype/tree/e9078f97 Diff: http://git-wip-us.apache.org/repos/asf/maven-archetype/diff/e9078f97 Branch: refs/heads/master Commit: e9078f97bf04a46649f42101c048ddfde5285433 Parents: d9566b0 Author: Petar Tahchiev <paranoia...@gmail.com> Authored: Sat Jan 16 17:51:54 2016 +0200 Committer: Petar Tahchiev <paranoia...@gmail.com> Committed: Sat Jan 16 17:51:54 2016 +0200 ---------------------------------------------------------------------- .../archetype/generator/DefaultFilesetArchetypeGenerator.java | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-archetype/blob/e9078f97/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java ---------------------------------------------------------------------- diff --git a/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java b/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java index 0b28263..1ce6c03 100644 --- a/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java +++ b/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java @@ -229,6 +229,8 @@ public class DefaultFilesetArchetypeGenerator binding.setVariable( entry.getKey().toString(), entry.getValue() ); } + binding.setVariable( "request", request ); + GroovyShell shell = new GroovyShell( binding ); shell.evaluate( postGenerationScript ); }