简体   繁体   English

Maven Archive无法读取或不是有效的Zip文件?

[英]Maven Archive cannot be read or is not a valid Zip file?

When running the Maven Install in Eclipse for my XXXXClient (web service) project, I repeatedly got this message: " Archive for required library: 'X:/XXXX/XXXX/.m2/repository/javax/enterprise/cdi-api/1.0-SP4-redhat-4/cdi-api-1.0-SP4-redhat-4.jar' in project 'XXXXClient' cannot be read or is not a valid ZIP file XXXXClient Build path Build Path Problem " for the following jars (dependencies in my project): 在Eclipse中为我的XXXXClient(Web服务)项目运行Maven Install时,我反复收到此消息:“ Archive for required library:'X:/XXXX/XXXX/.m2/repository/javax/enterprise/cdi-api/1.0项目'XXXXClient'中的-SP4-redhat-4 / cdi-api-1.0-SP4-redhat-4.jar'无法读取或不是有效的ZIP文件XXXXClient构建路径构建路径问题 “以下jar(依赖关系)我的项目):

  • jboss-el-api_2.2_spec-1.0.0.Final.jar 的jboss-EL-api_2.2_spec-1.0.0.Final.jar
  • cdi-api-1.0-SP4-redhat-4.jar CDI-API-1.0-SP4-红帽-4.jar
  • jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar 的jboss-JSF的api_2.1_spec-2.1.28.Final-的redhat-1.jar
  • jboss-jstl-api_1.2_spec-1.0.6.Final-redhat-1.jar 的jboss-JSTL-api_1.2_spec-1.0.6.Final-的redhat-1.jar
  • wsdl4j-1.6.3.redhat-1.jar WSDL4J-1.6.3.redhat-1.jar
  • jboss-saaj-api_1.3_spec-1.0.3.Final-redhat-1.jar 的jboss-SAAJ-api_1.3_spec-1.0.3.Final-的redhat-1.jar
  • jboss-jaxws-api_2.2_spec-2.0.2.Final-redhat-1.jar 的jboss-JAXWS-api_2.2_spec-2.0.2.Final-的redhat-1.jar
  • picketbox-infinispan-4.0.19.SP8-redhat-1.jar picketbox-Infinispan的-4.0.19.SP8-的redhat-1.jar
  • jboss-as-controller-client-7.4.0.Final-redhat-19.jar JBoss的-AS-控制器客户7.4.0.Final-红帽-19.jar
  • jboss-logging-3.1.4.GA-redhat-1.jar JBoss的日志记录-3.1.4.GA-的redhat-1.jar
  • resteasy-jaxb-provider-2.3.8.Final-redhat-3.jar RestEasy的-JAXB提供商 - 2.3.8.Final-的redhat-3.jar
  • async-http-servlet-3.0-2.3.8.Final-redhat-3.jar 异步HTTP的servlet的3.0-2.3.8.Final-的redhat-3.jar
  • resteasy-jaxrs-2.3.8.Final-redhat-3.jar RestEasy的-JAXRS-2.3.8.Final-的redhat-3.jar
  • resteasy-multipart-provider-2.3.8.Final-redhat-3.jar RestEasy的多域提供商 - 2.3.8.Final-的redhat-3.jar

Most of these jars can be found on the Maven Redhat repository: https://maven.repository.redhat.com/nexus/content/groups/product-techpreview/ 大多数这些罐子都可以在Maven Redhat存储库中找到: https//maven.repository.redhat.com/nexus/content/groups/product-techpreview/

In my Maven settings.xml, I have redhat-techpreview-all-repository and redhat-techpreview-eap-repository has active profiles. 在我的Maven settings.xml中,我有redhat-techpreview-all-repository和redhat-techpreview-eap-repository有活动的配置文件。 Both profiles are configured: 两个配置文件都配置为
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>

I noticed: 我注意到:

  • All the jars mentionned above had a size of 57K and 上面提到的所有罐子的大小都是57K和
  • threw errors when running the following command: jar -tvf [jarfile.jar]. 运行以下命令时抛出错误:jar -tvf [jarfile.jar]。
    I have also tried: mvn clean install -U (to force the redownload of jars), but it has not changed anything. 我也试过:mvn clean install -U(强制重新下载jar),但它没有改变任何东西。

The only way I found to resolve my problem was to manually download each jar and replace them one by one. 我找到解决问题的唯一方法是手动下载每个jar并逐个替换它们。

Why did I have corrupted jar files in the first place and Was there a better way to resolve this? 为什么我首先有损坏的jar文件,有没有更好的方法来解决这个问题?

Thanks in advance, 提前致谢,

I believe the "-U" flag will force a download of missing JARs, but it's possible for a corrupted version to be added to the repository (such as network glitches during download), which the -U flag will not fix. 我相信“-U”标志将强制下载丢失的JAR,但是可能会将损坏的版本添加到存储库(例如下载期间的网络故障),-U标志将无法修复。 When I've had this problem before I've been able to fix it by deleting the local .m2 repository and allowing Maven to redownload them. 当我通过删除本地.m2存储库并允许Maven重新下载它之前我已经解决了这个问题。

暂无
暂无

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

相关问题 eclipse maven错误:项目中所需库的归档无法读取或不是有效的ZIP文件 - eclipse maven error: Archive for required library in project cannot be read or is not a valid ZIP file Maven eclipse错误:“无法读取所需库的存档或不是有效的ZIP文件” - Maven eclipse error: "Archive for required library cannot be read or is not a valid ZIP file" 错误:无法读取所需库的存档或者不是有效的ZIP文件。 - Error: Archive for required library cannot be read or is not a valid ZIP file. 无法读取项目中所需库tomcat-embed-websocket的存档,或者该存档不是有效的ZIP文件 - Archive for required library tomcat-embed-websocket in project cannot be read or is not a valid ZIP file 所需库的存档:使用ChromeDriver Selenium Java无法读取项目“ XYZ”中的“ lib / Chrome / chromedriver”或该文件不是有效的ZIP文件 - Archive for required library: 'lib/Chrome/chromedriver' in project 'XYZ' cannot be read or is not a valid ZIP file using ChromeDriver Selenium Java 键入所需库的存档:无法读取项目&#39;starter&#39;中的spring-core-4.0.1.RELEASE.jar&#39;或它不是有效的ZIP文件 - Type Archive for required library: spring-core-4.0.1.RELEASE.jar' in project 'starter' cannot be read or is not a valid ZIP file Juno - Java Build Path - 项目无法读取或不是有效的ZIP文件 - Juno - Java Build Path - project cannot be read or is not a valid ZIP file simplecaptcha-1.2.1.jar 无法读取或不是有效的 ZIP 文件 - simplecaptcha-1.2.1.jar cannot be read or is not a valid ZIP file STS项目给出错误无法读取或不是有效的ZIP文件 - STS project gives error cannot be read or is not a valid ZIP file Eclipse Gradle插件: <some pom file> 无法读取或不是有效的ZIP文件 - Eclipse Gradle Plugin: <some pom file> cannot be read or is not a valid ZIP file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM