when you invoke a phase, maven invokes all the phases, in the
lifecycle to which the phase belongs, up to and including the phase
you specified
you are invoking the clean phase, which is part of the clean
lifecycle, so maven will invoke all the mojos attached to the pre-
clean phase, and then all those attached to the clean phase, and then
it will stop
the same confusion happens with integration tests... where people
think they should dunn them with "mvn integration-test" but this is
not the way they should work. the integration-test phase should run
all the tests and *never fail the build*. then a plugin attached to
the verify phase should check the results of the integration tests and
fail the build if necessary. with that case you invoke the integration
tests with "mvn verify". this allows a IT test container to be started
and stopped in the pre-it and post-it phases
Sent from my [rhymes with myPod] ;-)
On 13 Feb 2009, at 18:12, Kevin Witten <[email protected]> wrote:
From the maven documentation
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
My understanding of the maven clean lifecycle is that the following
phases
will be run in order when you perform a "mvn clean"
pre-clean
clean
post-clean
And with the ant plugin you can run code in any of these phases.
The issue is that the post-clean does not seem to work. Am I missing
something?
Here is a simple pom which does an ant echo task in each phase.
When I run "mvn clean", the post-clean is never echoed.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd
">
<modelVersion>4.0.0</modelVersion>
<groupId>com.nomadix</groupId>
<artifactId>Test</artifactId>
<name>Test</name>
<version>1.0.0</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>Extended-Pre-Clean</id>
<phase>pre-clean</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@</echo>
<echo>@
@</echo>
<echo>@ PRE-
CLEAN @</echo>
<echo>@
@</echo>
<echo>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@</echo>
</tasks>
</configuration>
</execution>
<execution>
<id>Extended-Clean</id>
<phase>clean</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@</echo>
<echo>@
@</echo>
<echo>@
CLEAN @</echo>
<echo>@
@</echo>
<echo>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@</echo>
</tasks>
</configuration>
</execution>
<execution>
<id>Extended-Post-Clean</id>
<phase>post-clean</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@</echo>
<echo>@
@</echo>
<echo>@ POST-
CLEAN @</echo>
<echo>@
@</echo>
<echo>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@</echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Thanks for the help,
Kevin
Notice● The information and attachment(s) contained in this communic
ation are intended for the addressee only, and may be confidential a
nd/or legally privileged. If you have received this communication i
n error, please contact the sender immediately, and delete this comm
unication from any computer or network system. Any interception, re
view, printing, copying, re-transmission, dissemination, or other us
e of, or taking of any action upon this information by persons or en
tities other than the intended recipient is strictly prohibited by l
aw and may subject them to criminal or civil liability. None of the
interTouch Group of Companies shall be liable for the improper and/
or incomplete transmission of the information contained in this comm
unication or for any delay in its receipt.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]