简体   繁体   English

Eclipse找不到Maven依赖项中可用的罐子

[英]eclipse cannot find the jar available in maven dependencies

I have a pom.xml with the following entry 我有一个带有以下条目的pom.xml

<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>

And on maven install the jar is added to the maven repository and is also listed in the maven dependencies library. 然后在maven安装中,将jar添加到maven存储库,并在maven依赖库中列出。

But I am not able to import any of the classes from the added jar 'spring-web-3.1.0.RELEASE.jar' for the particular entry, though it shows in the classpath 但是我无法从添加的jar'spring-web-3.1.0.RELEASE.jar'中为特定条目导入任何类,尽管它显示在类路径中

The error - in eclipse "cannot be resolved to a type" 错误-日食中的“无法解析为类型”

environment - maven 3.1 and Spring tool suite 环境-Maven 3.1和Spring工具套件

Thanks 谢谢

Solved - found the solution through some other forum 解决-通过其他论坛找到解决方案

The jar inside the repository was corrupted. 存储库中的jar已损坏。

After clearing the .m2 folder in the physical drive and repeating the maven clean install worked. 清除物理驱动器中的.m2文件夹并重复执行Maven全新安装后,即可进行。

Thanks for the time @techidiot @jtravaglini. 感谢您的时间@techidiot @jtravaglini。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM