See http://jira.codehaus.org/browse/MECLIPSE-37
There doesn't seem to be anything on the mailing lists to help with
this problem.
There is one person on the mailing list wanting to create a new custom
lifecycle (which is what I think is needed) and not configuring an
overlay of an existing lifecycle.
The discussion is around not using the default build lifecycle and to
create a new lifecycle with the following phases:
<phases>
<phase>generate-sources</phase>
<phase>generate-resources</phase>
<phase>generate-test-sources</phase>
<phase>generate-test-resources</phase>
</phases>
So that compilation, etc is not needed in order to create the eclipse
project files.
My investigation has lead me to the following conclusions:
META-INF/maven/lifecycle.xml
Is used to hook the current Mojo into an existing lifecycle (the one
bound to the packaging).
The <id> in the lifecycle.xml is only used for lookup and the phases
are overlaid on the existing lifecycle.
It is not used to define your own lifecycle (with custom phases - or
dropping existing phases)
META-INF/plexus/components.xml
When the packaging is "eclipse-plugin" (for creating eclipse pde
project files) then this defines a new
org.apache.maven.lifecycle.mapping.LifecycleMapping and
org.apache.maven.artifact.handler.ArtifactHandler. Giving it a
completely new and independent lifecycle.
However, the eclipse plugin needs its own lifecycle regardless of
the packaging type of the pom. I can use
@execute phase="generate-resources" lifecycle="eclipse-plugin"
But this only works if the plugin has been configured with
<extensions>true</extensions>
Which needs the plugin to be defined with this option in the pom.xml
I'd like to see extensions turned on by default for any command line
invoked plugin.
The http://maven.apache.org/developers/mojo-api-specification.html
indicates that it should be running the alternative lifecycle, but I
am finding that it runs the default lifecycle. e.g. if I change the
phase to "verify" (which does not exist in my lifecycle above) then I
can see in the build-output logs that it is running the default
lifecycle, with whatever plugins are attached to those phases for that
packaging.
i.e for packaging "eclipse-plugin" it is using the lifecycle defined
in components.xml and only running those four phases. But for other
packaging it is using the lifecycle for that packaging and whatever
additional bindings that have been defined in lifecycle.xml.
Also trying to use a different built-in lifecycle like "site" fails
with "Lifecycle 'site' not found in plugin", so no go hacking through
that route.
maven-lifecycle/src/main/mdo/maven-lifecycle.mdo
(https://svn.apache.org/repos/asf/maven/components/trunk/maven-lifecycle)
This defines the lifecyles in maven. There doesn't appear to be any
way to add to this list at runtime via a plugin.
I've tried adding a new org.apache.maven.lifecycle.LifecycleExecutor
similar to
http://svn.apache.org/repos/asf/maven/components/branches/maven-2.0.x/maven-core/src/main/resources/META-INF/plexus/components.xml
in the plugin's META-INF/plexus/components.xml file in the hope that
this one will be picked up by Maven instead of the one in maven-core
but that was just wishful thinking (my lack of Plexus knowledge is
showing).
Anyone have suggestions?
Thanks
Barrie
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]