欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

pom.xml引入新的依赖后报错:Description Resource Path Location Type Archive for required library: 'C:/Users/use...

程序员文章站 2022-04-28 09:30:52
...
  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