I'll try to decouple a few examples for you next week. Where we have
customization of the default lifecycle (what you call a mapping), and
a new lifecycle like the the site and clean lifecycles.
They all work, you're probably just getting tripped up on a detail
and the only documentation is the working code.
On 3 Aug 07, at 10:30 AM 3 Aug 07, Arnaud Bailly wrote:
Jason van Zyl <[EMAIL PROTECTED]> writes:
On 3 Aug 07, at 8:51 AM 3 Aug 07, Sebastien Brunot wrote:
Hey, great news !
Any pointer to a documentation for this, or to an entry point class
in the source code ?
Here's a full example:
http://svn.codehaus.org/plexus/plexus-appserver/trunk/plexus-
appserver-maven-plugin/
Hello,
I may be missing something, but the
example you are giving us seems to fall into solution 'one' I talked
about in a previous mail: custom lifecycle *mapping*.
BTW, I tried to follow Denis Cabasson's advice (yes, I read your
mails) to implement a custom lifecycle, which after all seems possible
as said in chap. 4 of the maven user guide at Sonatype
(http://www.sonatype.com/book/lifecycle.html).
Unfortunately it does not work :-( Or at least it does not work as I
think it would work.
I have a test project with 3 mojos;
- one: create a file and add one line
- two: add line to same file
- one-two: fork customcycle with phase two (or package in the second
version)
When I define my lifecycle.xml as this:
<lifecycles>
<lifecycle>
<id>customcycle</id>
<phases>
<phase>
<id>one</id>
<executions>
<execution>
<goals>
<goal>one</goal>
</goals>
</execution>
</executions>
</phase>
<phase>
<id>two</id>
<executions>
<execution>
<goals>
<goal>two</goal>
</goals>
</execution>
</executions>
</phase>
</phases>
</lifecycle>
</lifecycles>
I got this error in my test:
----------------------------------------------------------------------
---------
Test set: oqube.maven.archetype.CustomLifecycleCreationTest
----------------------------------------------------------------------
---------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.093
sec <<< FAILURE!
callingPluginShouldCreateOneFile
(oqube.maven.archetype.CustomLifecycleCreationTest)
Time elapsed: 2.065 sec <<< FAILURE!
org.apache.maven.it.VerificationException: Exit code was non-zero: 1;
log =
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'clean'.
....
[INFO] Preparing :one-two
[INFO]
----------------------------------------------------------------------
--
[ERROR] BUILD FAILURE
[INFO]
----------------------------------------------------------------------
--
[INFO] Unable to find lifecycle for phase 'two'
[INFO]
----------------------------------------------------------------------
--
[INFO] Trace
org.apache.maven.BuildFailureException: Unable to find lifecycle for
phase 'two'
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.getLifecycleForPha
se(DefaultLifecycleExecutor.java:916)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecyc
le(DefaultLifecycleExecutor.java:756)
at
But when I have a lifecycle such as
<lifecycles>
<lifecycle>
<id>customcycle</id>
<phases>
<phase>
<id>compile</id>
<executions>
<execution>
<goals>
<goal>one</goal>
</goals>
</execution>
</executions>
</phase>
<phase>
<id>package</id>
<executions>
<execution>
<goals>
<goal>two</goal>
</goals>
</execution>
</executions>
</phase>
</phases>
</lifecycle>
</lifecycles>
It works OK.
So it does not seem indeed possible to create custome lifecycle (in a
plugin ?), that is a sequence of particular phases different from the
standard maven phases.
Which is the right answer ?
Regards
--
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder and PMC Chair, Apache Maven
jason at sonatype dot com
----------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]