You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Graham Leggett <mi...@sharp.fm> on 2007/05/30 14:10:08 UTC

Plugin order when all plugins have the same phase

Hi all,

I have a project that needs to compile three things:

- Some java
- JNI / javah on the compiled java
- Build some C code using ant

Ideally all three of these configs need to be in the compile phase, but if
I do that, only the JNI build, or the C build will run - not both.

I tried putting the JNI stuff and C stuff into the process-classes phase,
but again, either one or the other runs, not both.

Can anyone explain how plugins can be executed - in order - when they are
bound to the same phase?

Regards,
Graham
--



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


Re: Plugin order when all plugins have the same phase

Posted by Graham Leggett <mi...@sharp.fm>.
On Wed, May 30, 2007 3:43 pm, Kenney Westerhof wrote:

> If you define 2 (different) plugins in the same phase, they should be
> executed
> sequentially (at least with maven 2.0.6).
> The only reason i can think of that only one of them executes is that you
> declared the
> same plugin twice, where the latter will overwrite the first one. If you
> want to run
> the same plugin twice, define 2 executions for that plugin.

This was with maven v2.0.4, which may have been a problem.

> Maybe it's easier to have 2 projects: one with the java as the main
> artifact,
> and also running javah to generate the headers and make that a secondary
> (attached)
> artifact, with a classifier (is probably done automatically).
> The second project will contain the c code and have a dependency on the
> headers artifact.

This is what we eventually went with.

Regards,
Graham
--



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


Re: Plugin order when all plugins have the same phase

Posted by Kenney Westerhof <ke...@apache.org>.
Hi,

Can you paste your pom.xml here?

If you define 2 (different) plugins in the same phase, they should be executed
sequentially (at least with maven 2.0.6).
The only reason i can think of that only one of them executes is that you declared the
same plugin twice, where the latter will overwrite the first one. If you want to run
the same plugin twice, define 2 executions for that plugin.

Maybe it's easier to have 2 projects: one with the java as the main artifact,
and also running javah to generate the headers and make that a secondary (attached)
artifact, with a classifier (is probably done automatically).
The second project will contain the c code and have a dependency on the headers artifact.

-- Kenney

Graham Leggett wrote:
> Hi all,
> 
> I have a project that needs to compile three things:
> 
> - Some java
> - JNI / javah on the compiled java
> - Build some C code using ant
> 
> Ideally all three of these configs need to be in the compile phase, but if
> I do that, only the JNI build, or the C build will run - not both.
> 
> I tried putting the JNI stuff and C stuff into the process-classes phase,
> but again, either one or the other runs, not both.
> 
> Can anyone explain how plugins can be executed - in order - when they are
> bound to the same phase?
> 
> Regards,
> Graham
> --
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

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