You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by gbois <gr...@bnpparibas.com> on 2006/12/12 17:44:06 UTC

Execute "mvn package" from a mojo

Hi,

>From a mojo, i generate an another sourceDirectory (modified source from the
original). 
And I want to execute the "mvn package" command
on this new source directory and a new set of dependency from the maven
plugin
How you make this?

Thanks in advance
-- 
View this message in context: http://www.nabble.com/Execute-%22mvn-package%22-from-a-mojo-tf2808635s177.html#a7836708
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


Re: Execute "mvn package" from a mojo

Posted by Edwin Punzalan <ep...@exist.com>.
You may be doing it wrong... or I may be reading it wrong, ;)

If your mojo is generating sources, you should do it in the 
generate-sources phase and add the directory where the generated sources 
are (usually in /target/generated-sources/mojo-name) in ${project}.  
This way, you can run "mvn package" on the project and mvn will process 
both sources (src/main/java and your generated sources).

But since you're modifying the original sources, you may not want to let 
maven process those anymore and instead just use the generated ones.  So 
I suggest that you do the same thing above, but instead of putting the 
original sources in src/main/java, put them in another directory (like 
src/main/draft).  This way, mvn will check for sources in src/main/java 
(finds nothing) and then proceeds to use only those sources added by 
your mojo at runtime.

If you've checked out the maven source code, you can find a good example 
in maven-model, which uses modello to generate the java sources.

Hope that helps.


^_^


gbois wrote:
> Hi,
>
> >From a mojo, i generate an another sourceDirectory (modified source from the
> original). 
> And I want to execute the "mvn package" command
> on this new source directory and a new set of dependency from the maven
> plugin
> How you make this?
>
> Thanks in advance
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org