Tuesday, September 27, 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" />

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...!

No comments:

Post a Comment