How can I execute several maven plugins within a single phase and set their respective execution order?

Yaneeve picture Yaneeve · Mar 24, 2010 · Viewed 12.5k times · Source

I would like to breakup certain phases in the maven life cycle into sub phases. I would like to control the execution flow from one sub-phase to another, sort of like with ant dependencies.

For example, I would like to use the NSIS plugin in order to package up my project into an installer at the package stage, AFTER my project had been packaged into a war file. I would like to do all that at the package phase.

Is that possible?

Answer

Pascal Thivent picture Pascal Thivent · Mar 24, 2010

Plugins bound to the same phase should be executed in the same order as they are listed in the POM. Under certain circumstances (e.g. if you bind the same plugin to a phase twice, like the antrun plugin), this may not occur but this is a bug (see MNG-2258 and the related issue MNG-3719).