Hi, I wanted to restrict the execution of maven-antrun-plugin to a particular phase. Normally if we specify the phase as "install" then whatever is specified in the phase "install" gets executed alongwith phases preceeding that in maven execution hierarchy, for example, test, compile etc. Is there any way in which I can restrict execution to only one phase while execution of the pom file. I have the following pom.xml :
<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>test</groupId> <artifactId>components-test</artifactId> <version>1.0</version> <packaging>pom</packaging> <build> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>one</id> <phase>install</phase> <inherited>no</inherited> <configuration> <tasks> <echo message="Install!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> <execution> <id>two</id> <phase>test</phase> <configuration> <tasks> <echo message="test!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project> Here I have two phases "install" and "test". While executing install is there any way in which I can skip the phase "test". Any pointers will be of great help for me. Thanks in advance, Regards, Shinjan