Pom.xml项目构建错误 [英] Pom.xml project build error
问题描述
我已经在eclipse中导入了maven项目,但是在pom.xml-中出现了以下错误-
I have imported maven projects in my eclipse, but I am getting the following error in pom.xml-
项目构建错误: "dependencyManagement.dependencies.dependency.systemPath"用于 jdk.tools:jdk.tools:jar必须指定绝对路径,但是 $ {JAVA_HOME}/lib/tools.jar
Project build error: 'dependencyManagement.dependencies.dependency.systemPath' for jdk.tools:jdk.tools:jar must specify an absolute path but is ${JAVA_HOME}/lib/tools.jar
我是Maven的新手,我们将不胜感激.
I am kind of new to maven, any help will be appreciated.
推荐答案
您已指定对jdk.tools:jdk.tools:jar
的依赖,且<systemPath>
为${JAVA_HOME}/lib/tools.jar
. ${JAVA_HOME}
不是有效的 Maven属性.读取环境变量JAVA_HOME
的语法为${env.JAVA_HOME}
.但是,相同的信息作为系统属性公开为java.home
,所以${java.home}
是最好的解决方案.
You've specified a dependency on jdk.tools:jdk.tools:jar
with a <systemPath>
of ${JAVA_HOME}/lib/tools.jar
. ${JAVA_HOME}
isn't a valid Maven property. The syntax to read the environment variable JAVA_HOME
is ${env.JAVA_HOME}
. However, the same information is exposed as a system property named java.home
, so ${java.home}
is the best solution.
这篇关于Pom.xml项目构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!