You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by m k <mk...@gmail.com> on 2006/09/13 17:33:59 UTC

Binding of goals to phases in multiple components.xml

Hello all,
  How does Maven resolve the lifecycle of a project when you have multiple
plugins listed in your build section that each have a components.xml for the
packaging type of the project being built?  If there is no overlap between
phases in the lifecycle is it possible to have one plugin bind certain
phases in the components.xml and another plugin define more phases in its
components.xml?

I am currently working on developing a maven plugin that will be used in
conjunction with another set of Maven plugins (one testing, one packaging,
one assembling, etc..) to build a variety of projects.  Each of the plugins
only cares about certain phases of the lifecycle and therefore will only
contain goals relevant to a small subset of the default lifecycle.  The goal
is to have each plugin contain a components.xml binding the default goals to
each of the packaging types we are supporting.  In theory this should
simplify the POM to simply be:

                <plugin>
                    <groupId>group</groupId>
                    <artifactId>xxxx-packaging-plugin</artifactId>
                    <extensions>true</extensions>
                </plugin>
                <plugin>
                    <groupId>group</groupId>
                    <artifactId>xxxx-testing-plugin</artifactId>
                    <extensions>true</extensions>
                </plugin>
                <plugin>
                    <groupId>group</groupId>
                    <artifactId>xxxx-assembly-plugin</artifactId>
                    <extensions>true</extensions>
                </plugin>

The goals would automatically be bound to the phase based on the packaging
type.  However in practice what I am seeing is that the only one of the
components.xml is being adhered to.  As an example the goals binded in the
packaging plugin are being ran but none of the testing and assembly plugins
are being ran.  In fact since the packaging plugin doesn't bind to certain
phases it seems like those phases are being ignored.

I know I can accomplish this desired behavior by listing the goals in the
executions section of the POM but I would ideally like this binding to
happen automatically.

If anyone has any knowledge about how components.xml between plugins are
resolved or if it is valid to have multiple components.xml please let me
know.

Thanks,
Micah