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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to