execute build.xml with maven

Is it possible to execute build.xml script with maven? This script checksout all my projects and subprojects and I’ve just got used to using maven, didn’t really use much of an ant before and I know ant can be used with maven so my question is how ?

  • git checkout branch from outside
  • How to checkout few files and folders alone without checking out entire source
  • How can I build a git tag in TeamCity?
  • Checking out svn repository without .svn files
  • How to override unmerged git checkout with upstream version
  • What's the difference between git reset file and git checkout file?
  • How do I configure a Jenkins Pipeline to be triggered by polling SubVersion?
  • Which style do you use for your commit messages? Technical or feature-based?
  • Undoing a commit in TortoiseSVN
  • File Management Server in JAVA
  • How do I revert the Subversion repository, not my working copy, to a specific revision?
  • SVN+SSH and Sourceforge
  • 2 Solutions collect form web for “execute build.xml with maven”

    I’m really not a big fan of this approach (either use Ant, or Maven, but not a bastard mix) but you can use an external build.xml with the Maven AntRun Plugin:

                <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                  classpathref="maven.plugin.classpath" />
                <ant antfile="${basedir}/build.xml">
                  <target name="test"/>

    And then run mvn antrun:run (or put the configuration inside an execution if you want to bind the AntRun plugin to a lifecycle phase, refer to the Usage page).

    Update: If you are using things from ant-contrib, you need to declare it as dependency of the plugin. I’ve updated the plugin configuration to reflect this. Also note the taskdef element that I’ve added (I’m not sure you need the classpathref attribute though).

    You can execute ant scripts via the Maven-Ant Plugin, but why do you need Ant to checkout your project? Haven’t you organized your sub-projects to be in the same tree?

    Git Baby is a git and github fan, let's start git clone.