Saturday, December 17, 2011

Maven ant run plugin

Simulate all the tasks of ant script and also used to call external ant targets from a maven pom.


<groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <version>1.7</version>
    <configuration>
      <tasks>
        <echo message="hello ant, from Maven!" />
        <echo>Maybe this will work?</echo>

        <ant antfile="${basedir}/build.xml">
          <target name="test" />
        </ant>

       <exec dir="${basedir}" executable="cmd"
         failonerror="true">
         <arg line="/K start" />
         <arg line="one.bat" />
       </exec>

      </tasks>
    </configuration>
   </plugin>
Sample Usage : mvn antrun:run

No comments:

Post a Comment