Friday, September 30, 2011

How to wrap the maven script with ant

Most of the time people need to do the other way around.
That mean to wrap ant scripts with maven scripts. But ,
in some rare situations there are people who want to wrap
maven scripts with ant scripts.

It is very easy to do this. You need to have maven
installed and set the MVN_HOME for this.

<project default="buildProject">   
      <property name="source.dir" value="."/>
 <target name="buildProject" description="Wrapper for the maven script">
     <exec dir="${source.dir}" executable="mvn">       
  <arg line="clean install" />
     </exec>
 </target>
</project>


place this code segment in your build.xml file. Place
that build.xml file in the folder which you have the
maven script (pom.xml). Go to the folder with command
prompt. Execute "ant" command. Thats all...!


source :http://shammijayasinghe.blogspot.com/2011/09/how-to-wrap-maven-script-with-ant.html

No comments:

Post a Comment