编译器错误“无法读取所需库的存档"- 弹簧工具套件 [英] Compiler error "archive for required library could not be read" - Spring Tool Suite

查看:42
本文介绍了编译器错误“无法读取所需库的存档"- 弹簧工具套件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始配置我的开发环境,我正在使用 Spring Tool Suite 2.8.1 和 m2E 1.01.

I am starting to configure my development environment and I am using Spring Tool Suite 2.8.1 along with m2E 1.01.

据我所知,由于这是一个 Maven 项目(我的第一个项目),我的 Maven POM 决定(连同 m2E 智能)我的项目构建配置和依赖项.

As far as I can tell, since this is a Maven Project (my first), my Maven POM is dictating (along with m2E smarts) my project build configuration and dependencies.

我想知道的是为什么我的 IDE 显示 Java 构建问题,内容为无法读取库 library/path/somejar.jar 所需的存档或不是有效的 zip 文件"什么时候可以在我的 .m2 存储库中看到 jars?

What I would like to know is why my IDE is displaying Java Build Problems that read "Archive required for library library/path/somejar.jar cannot be read or is not a valid zip file" when I can see the jars in my .m2 repository?

所有与 commons-logging:1.1.1 相关的错误,我在我的 parent-pom 中排除了这些错误.这是通过 spring-context-support:3.0.5 的传递依赖.我从我的构建中排除了该库,现在错误与 spring-context-support 库有关.

All the errors pertained to commons-logging:1.1.1 which I excluded in my parent-pom. This was a transistive dependancy via spring-context-support:3.0.5. I excluded that library from my build and now the errors pertain to the spring-context-support library.

我附上了一张截图来说明.

I have attached a screenshot to illustrate.

推荐答案

确实,IDE 经常缓存本地存储库(Eclipse 做了类似的事情,我必须重新启动 Eclipse).

Indeed IDEs often cache the local repository (Eclipse does something similar, and I have to relaunch Eclipse).

您可能遇到的一个丑陋的 maven 行为是,如果您在实际安装之前声明一个依赖项,maven 将创建一个缺失依赖项的空版本(包含元数据但没有 jar 的文件夹),您将不得不手动清理您的.m2 存储库.

One ugly maven behavior you might encounter is that if you declare a dependency before you actually install it, maven will create an empty version of the missing dependency (folder with metadata but no jar), and you will have to manually clean your .m2 repository.

第三,已安装的存档(jar...)可能会损坏,因此请尝试使用任何存档工具(7zip...)打开它进行测试,如果存档损坏,请删除整个文件夹.

Third, an installed archive (jar...) can get corrupted, so try to open it with any archive tool (7zip...) to test it, and delete the whole folder if the archive is corrupted.

这篇关于编译器错误“无法读取所需库的存档"- 弹簧工具套件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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