To generate Ant build file (build.xml) for our Maven project for integration purpose, we can use the Maven Ant plugin.
Locate your pom.xml file, and issue the command: mvn ant:ant
.
c:\mvn_test\xmlFileEditor>mvn ant:ant
The command above generates the following result.
c:\mvn_test\xmlFileEditor>mvn ant:ant [INFO] Scanning for projects... Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-ant-plugin/maven-metadata.xml Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-ant-plugin/maven-metadata.xml (464 B at 0.4 KB/sec) Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-ant-plugin/2.3/maven-ant-plugin-2.3.pom Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-ant-plugin/2.3/maven-ant-plugin-2.3.pom (6 KB at 43.7 KB/sec) Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-ant-plugin/2.3/maven-ant-plugin-2.3.jar Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-ant-plugin/2.3/maven-ant-plugin-2.3.jar (39 KB at 120.2 KB/sec) [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building xmlFileEditor 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-ant-plugin:2.3:ant (default-cli) @ xmlFileEditor --- Downloading: https://repo.maven.apache.org/maven2/org/apache/ant/ant/1.7.1/ant-1.7.1.pom Downloaded: https://repo.maven.apache.org/maven2/org/apache/ant/ant/1.7.1/ant-1.7.1.pom (10 KB at 55.7 KB/sec) Downloading: https://repo.maven.apache.org/maven2/org/apache/ant/ant-parent/1.7.1/ant-parent-1.7.1.pom Downloaded: https://repo.maven.apache.org/maven2/org/apache/ant/ant-parent/1.7.1/ant-parent-1.7.1.pom (5 KB at 31.4 KB/sec) Downloading: https://repo.maven.apache.org/maven2/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.pom Downloaded: https://repo.maven.apache.org/maven2/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.pom (3 KB at 13.7 KB/sec) Downloading: https://repo.maven.apache.org/maven2/xalan/xalan/2.7.0/xalan-2.7.0.pom Downloaded: https://repo.maven.apache.org/maven2/xalan/xalan/2.7.0/xalan-2.7.0.pom (491 B at 3.5 KB/sec) Downloading: https://repo.maven.apache.org/maven2/org/apache/ant/ant/1.7.1/ant-1.7.1.jar Downloading: https://repo.maven.apache.org/maven2/xalan/xalan/2.7.0/xalan-2.7.0.jar Downloading: https://repo.maven.apache.org/maven2/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar Downloaded: https://repo.maven.apache.org/maven2/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar (12 KB at 33.2 KB/sec) Downloaded: https://repo.maven.apache.org/maven2/org/apache/ant/ant/1.7.1/ant-1.7.1.jar (1292 KB at 1069.5 KB/sec) Downloaded: https://repo.maven.apache.org/maven2/xalan/xalan/2.7.0/xalan-2.7.0.jar (2667 KB at 1169.5 KB/sec) [INFO] Wrote Ant project for xmlFileEditor to c:\mvn_test\xmlFileEditor [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7.287 s [INFO] Finished at: 2014-11-22T20:21:11-08:00 [INFO] Final Memory: 21M/369M [INFO] ------------------------------------------------------------------------ c:\mvn_test\xmlFileEditor>