You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Stephan Behnke (JIRA)" <ji...@codehaus.org> on 2009/12/07 12:35:55 UTC
[jira] Commented: (ARCHETYPE-58) Allows for additional properties
in velocity context and also conditional processing of source, resources
etc
[ http://jira.codehaus.org/browse/ARCHETYPE-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=201522#action_201522 ]
Stephan Behnke commented on ARCHETYPE-58:
-----------------------------------------
I can't quite follow - is this feature now implemented or not? If yes, what's the final syntax?
> Allows for additional properties in velocity context and also conditional processing of source, resources etc
> -------------------------------------------------------------------------------------------------------------
>
> Key: ARCHETYPE-58
> URL: http://jira.codehaus.org/browse/ARCHETYPE-58
> Project: Maven Archetype
> Issue Type: New Feature
> Components: Generator
> Affects Versions: 1.0-alpha-4
> Reporter: Philip Dodds
> Fix For: 2.0-alpha-1
>
> Attachments: ARCHETYPE-58-a-slightly-different-kind-of-patch, properties_and_conditions.patch
>
>
> Need the ability to add new properties to the velocity context during the processing of an archetype through archetype-core.
> Also need the ability to determine whether to optionally include a resource, source etc based on a conditional test on a property.
> Consider for example adding properties and optional tests as follows:
> <archetype>
> <id>servicemix-se</id>
> <sources>
> <conditional>
> <source>src/main/java/MyBootstrap.java</source>
> <propertyEqual property="generateBootstrap" value="true"/>
> </conditional>
> <source>src/main/java/MyComponent.java</source>
> <source>src/main/java/MyEndpoint.java</source>
> </sources>
> <testSources>
> <source>src/test/java/MySpringComponentTest.java</source>
> </testSources>
> <testResources>
> <resource>src/test/resources/spring.xml</resource>
> <resource>src/test/resources/log4j.properties</resource>
> </testResources>
> <contextProperties>
> <property name="pluginRepositoryId" value="apache.snapshots"/>
> <property name="pluginRepositoryName" value="Maven Central Plugins Development Repository"/>
> <property name="pluginRepositoryUrl" value="http://cvs.apache.org/maven-snapshot-repository"/>
> <property name="pluginRepositorySnapshotsEnabled" value="true"/>
> <property name="pluginRepositoryReleasesEnabled" value="true"/>
> <property name="generateBootstrap" value="false"/>
> </contextProperties>
> </archetype>
> The example above shows that we want to be able to gather additional properties and then in the sources conditionally determine whether we want to include it.
> I will attach a patch that already implements the contextProperties as shown above and has 80% of the code in place for the conditional inclusion of files.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira