You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Sonntag <fr...@googlemail.com> on 2010/10/08 14:23:23 UTC
Archetype and "post creation tasks"
Hello everyone,
trying to figure out the "Maven way" to do the following:
I created an archetype that sets up a multi module project. After the
creation of the new project, I want to run some other tasks, in my
case there should be some classes generated from a database schema. I
already created a Maven mojo as a wrapper for that generator, because
one should also be able to call it independently. Regarding ease of
use, the project creation and generation of files should be performed
with one single command (so I don't want to do 'mvn
archetype:generate[...]' and then 'cd newproject; mvn
mygenerator:generate') and that's exactly my problem: how can I
achieve that in a "clean" way? I already thought about creating
another mojo that wraps the archetype and plugin calls, but that feels
rather bumpy...
What's the recommended way to do something like this?
Thanks for any hints.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Archetype and "post creation tasks"
Posted by Antonio Petrelli <an...@gmail.com>.
2010/10/8 Michael Sonntag <fr...@googlemail.com>:
> I created an archetype that sets up a multi module project. After the
> creation of the new project, I want to run some other tasks, in my
> case there should be some classes generated from a database schema. I
> already created a Maven mojo as a wrapper for that generator, because
> one should also be able to call it independently. Regarding ease of
> use, the project creation and generation of files should be performed
> with one single command (so I don't want to do 'mvn
> archetype:generate[...]' and then 'cd newproject; mvn
> mygenerator:generate') and that's exactly my problem: how can I
> achieve that in a "clean" way? I already thought about creating
> another mojo that wraps the archetype and plugin calls, but that feels
> rather bumpy...
>
> What's the recommended way to do something like this?
Try "goals" parameter:
http://maven.apache.org/archetype/maven-archetype-plugin/generate-mojo.html#goals
However, since I've never tried it, I don't know if these goals are
executed before or after the project generation.
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Archetype and "post creation tasks"
Posted by Luke Patterson <lu...@gmail.com>.
On Fri, Oct 8, 2010 at 7:23 AM, Michael Sonntag <fr...@googlemail.com> wrote:
> ... Regarding ease of
> use, the project creation and generation of files should be performed
> with one single command (so I don't want to do 'mvn
> archetype:generate[...]' and then 'cd newproject; mvn
> mygenerator:generate') ...
take a look at http://docs.codehaus.org/display/MAVENUSER/Allow+goals+to+be+attached+to+post+Velocity+template+process+in+archetype+generation
something like what is proposed there is probably what you want
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org