maven-bundle-plugin bundle packaging lifecycle


In Maven the element in the pom.xml corresponds to a lifecycle to use to build the code. The lifecycle in turn comprises a number of phases, each of which is bound to goals provided by plugins. (NB: since this is a 1:1 relationship we can use packaging and lifecycle interchangeably).

The Maven defaults for lifecycles, phases and phase-to-goal bindings are in a file called component.xml. For Maven 2.0.x this lives here.

There are three lifecycles: ‘default’, ‘clean’ and ‘site’, the first being by far the most involved and including compilation, running tests etc. More detail on Maven lifecycles here.

It is also possible for Maven plugins to define their own lifecycle (as per the Maven book), provided that they specify true. So for example the maven-bundle-plugin does exactly this, defining a ‘bundle’ lifecycle. The phases and goal bindings for this lifecycle are similar to the ‘default’ lifecycle. See the maven-bundle-plugin’s components.xml here.

July 21, 2008 maven java