ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: calling maven2 files from ant
Date Tue, 06 Jun 2006 09:43:38 GMT
EJ Ciramella wrote:
> Without some really hacky scripty goodness, is there a clever way to
> call maven2 with an ant script?
>  
> I'm working on getting a maven 2 based project up and running under
> cruisecontrol and I've taken advantage of lots of little ant benefits.
> Some things simply don't work using maven 2 directly, but having ant
> call into maven would make things much easier.
> 

Axis2's build.xml delegates to maven1

     <property name="maven.commoncmd" value="--emacs" />
     <condition property="maven.line"
         value="--offline ${maven.commoncmd}">
       <istrue value="${offline}"/>
     </condition>

     <condition property="maven.executable" value="maven.bat">
       <os family="windows" />
     </condition>
     <property name="maven.executable" value="maven" />

     <property name="maven.line" value="${maven.commoncmd}" />
     <presetdef name="maven">
       <exec failonerror="true" executable="${maven.executable}">
        <arg line="${maven.line}" />
       </exec>
     </presetdef>

this is used in targets like

   <target name="clean" depends="init"
       description="clean everything">
     <maven>
       <arg value="multiproject:clean"/>
     </maven>
   </target>

   <target name="dist" depends="init"
       description="make a distribution">
     <maven>
     </maven>
   </target>

   <target name="dist-lite" depends="init"
       description="make a distribution, skip testing">
     <maven>
       <arg value="-Dmaven.test.skip=true" />
     </maven>
   </target>

   <target name="create-lib" unless="jars.present" depends="init"
       description="creates the libraries">
     <maven>
       <arg value="create-lib" />
     </maven>
   </target>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message