本地存储库中缺少tools.jar会破坏m2eclipse [英] Missing tools.jar in local repository breaks m2eclipse

查看:117
本文介绍了本地存储库中缺少tools.jar会破坏m2eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的问题是eclipse无法解决任何项目的依赖关系。这导致问题,因为即使依赖关系似乎在编码时工作正常(我得到自动完成),我仍然收到一个巨大的错误列表,提到缺少的工件。



过滤这些,我发现以下内容:


容器'Maven Dependencies'引用不存在的库'/home/[...]/.m2 /repository/com/sun/tools/1.5.0/tools-1.5.0.jar'


似乎这个依赖是由struts2介绍,他们在pom中设置了如下配置文件:

 < dependency> 
< groupId> com.sun< / groupId>
< artifactId> tools< / artifactId>
< version> 1.5.0< / version>
< scope> system< / scope>
< systemPath> $ {java.home} /../ lib / tools.jar< / systemPath>
< / dependency>

systemPath解析,所以我没有看到为什么会造成麻烦的原因。在任何情况下,有没有办法告诉eclipse这个m2eclipse依赖关系是在本地存储库中找不到的系统依赖关系?

解决方案

我面临同样的问题,需要做以下事情: b
$ b


  • 添加了 -vm 路径/

  • 清理现有工作区并重新加载项目。



它无缝地为我工作。



值得补充的是,在我的 eclipse.ini 文件中,我不得不添加 -vm ... 行在文件的顶部。像

  -vm 
C:\Program Files\Java\jdk1.6.0_27 \bin
... ...

确保, - vm选项放在-vmargs之前,将-vmargs直接传递到vm之后的所有内容,并选择一个特定的依赖于-vm选项。


The problem I'm experiencing is that eclipse can't resolve any of the dependencies of my project. This causes problems because even though the dependencies seem to work alright when coding (I get autocompletion) I still get a huge list of errors referring to missing artifacts.

When filtering these, I found the following:

The container 'Maven Dependencies' references non existing library '/home/[...]/.m2/repository/com/sun/tools/1.5.0/tools-1.5.0.jar'

It seems that this dependency was introduced by struts2, who have a profile set up as follows in their pom:

<dependency>
    <groupId>com.sun</groupId>
    <artifactId>tools</artifactId>
    <version>1.5.0</version>
    <scope>system</scope>
    <systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>

That systemPath resolves and so I don't see a reason why this would be causing trouble. In any case, is there a way to tell eclipse that this m2eclipse dependency is a system dependency that is not found in the local repository?

解决方案

I was facing the same problem and needed to do the following things

  • Added -vm path/to/jdk/bin in eclipse.ini file
  • Clean the existing workspace and reload the project.

It worked for me seamlessly.

Its worth to add that, in my eclipse.ini file I had to add the -vm ... lines at the top of the file. like

-vm
C:\Program Files\Java\jdk1.6.0_27\bin
... ... ...

Make sure that, -vm option is placed before -vmargs as everything after -vmargs is passed directely to vm and selecting a particular is depend on -vm option.

这篇关于本地存储库中缺少tools.jar会破坏m2eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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