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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to