統一されたMavenビルドを使用して、既存のJavaプロジェクトの束を改造しています。maven-antrun-plugin
各プロジェクトは成熟しており、次のように既存の実行に使用しているすべての Ant ベースのビルドを確立してbuild.xml
います。
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<tasks>
<ant antfile="build.xml" target="compile" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
ビルドを実行mvn compile
すると、次のメッセージが表示されて失敗します。
[INFO] An Ant BuildException has occured: The following error occurred
while executing this line:
build.xml:175: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Java\jdk1.6.0_13\jre"
私を困惑させるのは
- 私は
JAVA_HOME=C:\Java\jdk1.6.0_13
自分の環境セットアップの一部として持っており、mvn.bat
それが実行されると、それはまさに私が得ている値ですが、エラーメッセージに表示されるように、C:\Java\jdk1.6.0_13\jre
- すべてを実行
ant compile
すると、問題なくコンパイルされます
おそらくmaven-antrun-plugin
次のようなことをするということset JAVA_HOME=%JAVA_HOME%\jre
ですか?バッチ/ビルド ファイルを検索しましたが、その変更が発生した場所が見つかりません