0

I have 2 execution to be executed in different time.

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
            <execution>

                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <target>
                        <echo>Executing bat file</echo>
                            <exec executable="exec.bat">
                                <arg value="Hello world" />
                            </exec>
                        </target>
                    </configuration>
                </execution>
             <execution>
                    <id>default-cli</id>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <target>
                            <echo>Executing another bat file</echo>
                            <exec executable="exec1.bat">
                                <arg value="Hello world" />
                            </exec>
                        </target>
                    </configuration>
                </execution>

            </executions>
            <dependencies>
                <dependency>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant</artifactId>
                    <version>1.9.4</version>
                </dependency>
            </dependencies>
        </plugin>

When I run mvn, I need to just run execution 1, next time I need to run execution 2. I tried to add other goal, it is stating goal not found. I added ID and tried to run antrun:run@id1 but still no luck. Is there any other way to do this. I'll run two things, like antrun:run will execute execution 1, and something to run execution 2.

Pasupathi Rajamanickam
  • 1,982
  • 1
  • 24
  • 48

0 Answers0