从githud存储库中提取最新代码后,得到以下结果:
为org.codehaus.mo构建有效模型时遇到的问题
错误的完整描述如下。
在为
建立有效模型时遇到一个问题org.codehaus.mojo:aspectj-maven-plugin:1.8
[ERROR] 'dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${toolsjarSystemPath} @
我正在使用java1.8和sts3.6.4
很可能JAVA_HOME环境变量指向JDK而不是JRE。修改环境变量并重启Eclipse。
aspectj-maven-plugin包含以下内容:
<profile>
<id>standardToolsJar-profile</id>
<activation>
<activeByDefault>true</activeByDefault>
<file>
<exists>${java.home}/../lib/tools.jar</exists>
</file>
</activation>
<properties>
<toolsjarSystemPath>${java.home}/../lib/tools.jar</toolsjarSystemPath>
</properties>
</profile>
<profile>
<id>appleJdkToolsJar-profile</id>
<activation>
<activeByDefault>false</activeByDefault>
<file>
<exists>${java.home}/../Classes/classes.jar</exists>
</file>
</activation>
<properties>
<toolsjarSystemPath>${java.home}/../Classes/classes.jar</toolsjarSystemPath>
</properties>
</profile>
<profile>
<id>java8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<properties>
<additionalparam>-Xdoclint:none</additionalparam>
</properties>
</profile>
我认为这失败的原因是activeByDefault不会触发,因为java8配置文件激活被触发。由于错误的${java.home}, File ->exists条件将不会触发。${toolsjarSystemPath}将不会被设置,并且尝试使用它将导致异常。