Pom.xml项目构建错误 [英] Pom.xml project build error

查看:151
本文介绍了Pom.xml项目构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆