maven ant run プラグインを介して実行しようとしている ant プロジェクトがあります。ant run プラグインを使用すると、ant クラスへのインポートを含むソースのコンパイル中に次の例外が発生しますが、ant を使用してビルドを正常に実行できます。
[javac] xxxx/ant/src/org/apache/hadoop/hive/ant/GetVersionPref.java:21: package org.apache.tools.ant does not exist
[javac] import org.apache.tools.ant.AntClassLoader;
[javac] ^
[javac] xxxx/ant/src/org/apache/hadoop/hive/ant/GetVersionPref.java:22: package org.apache.tools.ant does not exist
[javac] import org.apache.tools.ant.BuildException;
関連する ant ビルド ファイルのスニペットを次に示します。
<property name="myclasspath" refid="classpath"/>
<!-- Emit the property to the ant console -->
<echo message="Classpath = ${myclasspath}"/>
<javac
encoding="${build.encoding}"
srcdir="${src.dir}"
includes="**/*.java"
destdir="${build.classes}"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
includeantruntime="true">
<compilerarg line="${javac.args} ${javac.args.warnings}" />
<classpath refid="classpath"/>
</javac>
印刷されたクラスパスには、どちらの場合も (直接実行する場合も、ant 実行プラグインを介して実行する場合も) ant jar が含まれていないため、最初のケースでは、ant ライブラリが javac クラスパスに暗黙的に含まれていると推測しています。この問題を解決するための提案をいただければ幸いです。