Thanks Martin. I've looked through all 3 parts, but can't find any details
on passing custom paramters to the archetype.
E.g. in my generated code if I want to be able to substitute ${myProperty},
I can't figure out how to supply this to Maven via the command line, e.g:
mvn archetype:generate -DarchetypeGroupId=%ARCHETYPE_GROUPID%
-DarchetypeArtifactId=%ARCHETYPE_ARTIFACTID%
-DarchetypeVersion=%ARCHETYPE_VERSION% -DgroupId=%GROUPID%
-DartifactId=%MODULE_PREFIX%%MODULE_NAME%
-Dpackage=%PACKAGE_PREFIX%%MODULE_NAME_PACKAGE% -Dversion=%VERSION%
-DmyProperty=test
However, if I use M2Eclipse there is a section for specifying the archetype
parameters including a list of custom name/value parameters. If I use this
section to specify, e.g. myProperty=test then the project is generated with
this value correctly substituted.
Thanks again,
Steve.
matinh wrote:
>
> Did you have a look at
> http://blogs.mikeci.com/2010/01/14/working-with-custom-maven-archetypes-part-1/
> and
> http://blogs.mikeci.com/2010/01/26/working-with-custom-maven-archetypes-part-2/
> and its references!
>
> hth,
> - martin
>
> Am Montag, 26. April 2010 10:44:29 schrieb slew77:
>> Anyone have any idea on this? It's really frustrating me :confused:
>>
>> Thanks,
>> Steve.
>>
>> slew77 wrote:
>> > I'm trying to do the same thing - can someone post instructions, I've
>> > searched everywhere. I can see it's possible as when I use m2eclipse
>> it
>> > allows me to specify custom properties that are picked up, I just can't
>> > figure out how to do it from the command line.
>> >
>> > Thanks,
>> > Steve.
>> >
>> > iiggzz wrote:
>> >> I found it out! So if anybody has the same problem go ahead and ask
>> me.
>> >> Now I have another problem. I need to specify the path to my files
>> like
>> >> this: ${projectName}-mymodule/myfile.txt so after creation it should
>> >> look like this: helloworld-mymodule.
>
>
>
--
View this message in context:
http://old.nabble.com/passing-parameters-to-plugin-Archetype-tp16807963p28363473.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]