You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Agoston Bejo <be...@yahoo.com> on 2008/11/07 12:26:33 UTC
Parametrizing directory names in an archetype
Hello!
The question ist the following: can I somehow achieve that directory names in the project generated with the archetype are passed as parameters? I'm talking about something like this:
In the archetype:
resources/archetype-resources/src/test/java/$param1/App.java
Then you could generate your project like
mvn archetype:generate ... -Dparam1=serverutils
and you would end up having a directory + file like
src/test/java/serverutils/App.java
Is that possible with the archetype plug-in?
Thanks,
Agoston
Re: Parametrizing directory names in an archetype
Posted by stug23 <pa...@gmail.com>.
The 2.0-alpha-4 archetype plugin can do this for filenames -- I haven't tried
it with directory names, however this definitely works for sub module
directories so I think it will work in the general case.
The syntax for your example is (double underscore before and after the
property name):
resources/archetype-resources/src/test/java/__param1__/App.java
And you will need to use this in the meta data file as well.
For more info see
<http://maven.apache.org/plugins/maven-archetype-plugin/examples/create-multi-module-project.html>
and
<http://jira.codehaus.org/browse/ARCHETYPE-191>
Bugzilla from bejoag2@yahoo.com wrote:
>
> Hello!
>
> The question ist the following: can I somehow achieve that directory names
> in the project generated with the archetype are passed as parameters? I'm
> talking about something like this:
>
> In the archetype:
> resources/archetype-resources/src/test/java/$param1/App.java
>
> Then you could generate your project like
> mvn archetype:generate ... -Dparam1=serverutils
>
> and you would end up having a directory + file like
> src/test/java/serverutils/App.java
>
>
> Is that possible with the archetype plug-in?
>
> Thanks,
> Agoston
>
>
>
>
>
--
View this message in context: http://www.nabble.com/Parametrizing-directory-names-in-an-archetype-tp20378844p20392518.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org