Hi All,


Is there a way I can invoke a plug-in/goal (not linked with any phase)
configured in a project's pom.xml (within an execution tag) from the command
line directly, also the idea is to invoke the goal irrespective of the maven
build cycle.



To be more precise let's say if I have a maven-ant-run: run (plug-in:goal)
configured (as below) with 2 executions (i.e. execution1 associated with
validate phase and execution2 not linked to any phase) how can I invoke the
configuration as configured in id=execution2 from command line directly e.g.
something like mvn antrun:run "execution2" so that it gets executed
independent of maven phase(s)/build-cycle.



<build>

      <plugins>

            <plugin>

                  <artifactId>maven-antrun-plugin</artifactId>

                  <executions>

                        <execution>

                              <id>execution1</id>

                              <phase>validate</phase>

                              <configuration>

                                    <tasks>

                                          <delete file="lib/test1.txt"/>

                                    </tasks>

                              </configuration>

                              <goals>

                                    <goal>run</goal>

                              </goals>

                        </execution>

                        <execution>

                              <id>execution2</id>

                              <configuration>

                                    <tasks>

                                          <delete file="lib/test2.txt"/>

                                    </tasks>

                              </configuration>

                              <goals>

                                    <goal>run</goal>

                              </goals>

                        </execution>

                  </executions>

            </plugin>

      </plugins>

</build>



Thanks and Regards,



Farhan.

Reply via email to