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 communication are 
intended for the addressee only, and may be confidential and/or legally 
privileged.  If you have received this communication in error, please contact 
the sender immediately, and delete this communication from any computer or 
network system.  Any interception, review, printing, copying, re-transmission, 
dissemination, or other use of, or taking of any action upon this information 
by persons or entities other than the intended recipient is strictly prohibited 
by law 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 communication or 
for any delay in its receipt.

Reply via email to