場合によっては、プロジェクトの統合目的でAntビルドファイル(

build.xml

)を生成する必要があります。たとえば、http://www.klocwork.com/products/insight/[klockworkコード解析ツール]は、Javaプロジェクトの静的コード解析プロセスを実行するためのAntファイルです。

Maven Antプラグイン

Mavenには、AntビルドファイルをMaven pom.xmlから簡単に生成するための便利なAntプラグインが付属しています。 pom.xmlファイルを探して、次のコマンドを実行します。

D:\Project__ABC>mvn ant:ant

出力

D:\Project__ABC\SWP>mvn ant:ant[INFO]Scanning for projects...[INFO]Searching repository for plugin with prefix: 'ant'.[INFO]artifact org.apache.maven.plugins:maven-ant-plugin: checking for updates from central
...

[INFO]------------------------------------------------------------------------

[INFO]Building abc

[INFO]   task-segment:[ant:ant]

[INFO]------------------------------------------------------------------------

...
Downloading: http://repo1.maven.org/maven2/xalan/xalan/2.7.0/xalan-2.7.0.pom
491b downloaded
...

ダウンロード:http://repo1.maven.org/maven2/xalan/xalan/2.7.0/xalan-2.7.0.jar
2666Kがダウンロードされました[情報][アリ:アリ]

[INFO]Wrote Ant project for ABC to D:\Project__ABC

[INFO]------------------------------------------------------------------------

[INFO]BUILD SUCCESSFUL

[INFO]------------------------------------------------------------------------

[INFO]Total time: 28 seconds

[INFO]Finished at: Thu Feb 12 16:16:15 SGT 2009

[INFO]Final Memory: 9M/16M

[INFO]------------------------------------------------------------------------

Done

Maven just created 3 Ant files – build.xml, maven-build.xml and
maven-build.properties.