Hi, If a build phase is called, it will execute not only this phase but also every phase prior to the specified build phase. There is no way you can restrict the execution to only one phase. You can specify a "goal" though.
Anyway, you can't skip the test phase. However, if you want to skip the tests (maven-surefire-plugin), you can just add "-Dmaven.test.skip=true". Hope this helps. Dawn shinjan sen wrote: > > 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 > > -- View this message in context: http://www.nabble.com/Need-Help-%7C-Restricting-execution-to-a-particular-phase-only-tf2929911s177.html#a8211943 Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
