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
Attachments: 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