pom.xml引入新的依赖后报错:Description Resource Path Location Type Archive for required library: 'C:/Users/username/.m2/repository/org/apache/httpcomponents/httpcore-nio/4.4.1/httpcore-nio-4.4.1.jar' in project 'projectName' cannot be read or is not a valid ZIP file projectName

  1. 问题产生的情景:当配置好的pom.xml中再次添加新的依赖,此时报错
Description Resource    Path    Location    Type Archive for required library: 
'C:/Users/username/.m2/repository/org/apache/httpcomponents/httpcore-
nio/4.4.1/httpcore-nio-4.4.1.jar' in project 'projectName' cannot be read or is 
not a valid ZIP file    projectName
  1. 原因:已经引入的依赖和新添加的依赖在httpcore-nio-4.4.1.jar 上面产生冲突
  2. 解决
To fix issues like that, let Maven download the files again:

Delete the folder D:/mypath/.m2/repository/javax/transaction/jta
Run Maven with -U so it tries broken downloads again.
That should try to download the file again and clean up any "residue" in your local repository.

If Eclipse still complains that the JAR file is corrupt:

Refresh your project 
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容