Maven报错Missing artifact jdk.tools:jdk.tools:jar:1.7

在Eclipse中检出Maven工程,一直报这个错:“Missing artifact jdk.tools:jdk.tools:jar:1.7”


看整个pom.xml文件也不见其他异常。

而tools.jar包是JDK自带的,于是怀疑pom.xml中以来的包隐式依赖tools.jar包,而tools.jar并未在库中,

好比:当前工程依赖A包,而A包在开发打包过程依赖tools.jar包,现在A发布了,我们的工程依赖A包,所以我们应该在包依赖中加上tools.jar包;


这样分析后,问题就好解决了,直接在pom.xml中加上一个依赖项目:

[html]  view plain  copy
  1. <dependency>  
  2.     <groupId>jdk.tools</groupId>  
  3.     <artifactId>jdk.tools</artifactId>  
  4.     <version>1.7</version>  
  5.     <scope>system</scope>  
  6.     <systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>  
  7. </dependency>  


问题得到解决。


If the jdk.tools is present in the .m2 repository. Still you get the error something like this:

missing artifact: jdk.tools.....c:.../jre/..

In the buildpath->configure build path-->Libraries.Just change JRE system library from JRE to JDK



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值