阅读背景:

Maven:运行Maven时打开zip文件时出错

来源:互联网 
[ERROR] error: error reading C:\Users\suresh\.m2\repository\org\jdom\jdom
[ERROR] error: error reading C:\Users\suresh\.m2\repository\org\jdom\jdom\1.1\jdom-1.1.jar; error in opening zip file
[ERROR] error: error reading C:\Users\suresh\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar; error in opening zip file
[ERROR] error: error reading C:\Users\suresh\.m2\repository\org\apache\cxf\cxf-rt-bindings-http\2.2.1\cxf-rt-bindings-http-2.2.1.jar; error in opening zip file
[ERROR] error: error reading C:\Users\suresh\.m2\repository\org\codehaus\jra\jra\1.0-alpha-4\jra-1.0-alpha-4.jar; error in opening zip file
[ERROR] error: error reading C:\Users\suresh\.m2\repository\org\apache\cxf\cxf-api\2.2.1\cxf-api-2.2.1.jar; error in opening zip file
[ERROR] error: error reading C:\Users\suresh\.m2\repository\org\apache\cxf\cxf-common-utilities\2.2.1\cxf-common-utilities-2.2.1.jar; error in opening zip file
[INFO] 44 errors

How to resolve this error while running mvn clean install?

如何在运行mvn清理安装时解决此错误?

And I see that, on to the repository path in my disk, starting from servlet, no packages are being created inside repository.

我看到,在我的磁盘的存储库路径上,从servlet开始,在存储库中没有创建包。

11 个解决方案

#1


58  

Probably, contents of the JAR files in your local .m2 repository are HTML saying "301 Moved Permanently". It seems that mvn does not handle "301 Moved Permanently" properly as expected. In such a case, download the JAR files manually from somewhere (the central repository, for example) and put them into your .m2 repository.

可能,本地.m2存储库中的JAR文件的内容是HTML,表示“301永久移动”。mvn似乎没有按照预期正确处理“301永久转移”。在这种情况下,从某个地方(例如中央存储库)手动下载JAR文件,并将它们放入您的.m2存储库中。

See also:

参见:

asm-3.1.jar; error in opening zip file
https://darutk-oboegaki.blogspot.jp/2012/07/asm-31jar-error-in-opening-zip-file.html

asm-3.1.jar;打开zip文件https://darutk- oboegaki.blogspot.jp2/7/asm -31jar-error- open -zip-file.html时出错

#2


38  

This error sometimes occurs. The files becomes corrupt. A quick solution thats works for me, is:

有时会发生这个错误。文件变得腐败。一个对我有效的快速解决方案是:

  • Go to your local repository (in general /.m2/) in your case I see that is C:\Users\suresh.m2)
  • 去你的本地存储库(一般/ .m2 /)在你的情况中我看到C:\Users\ suresh.m2)
  • Search for the packages that makes conflicts (in general go to repository/org) and delete it
  • 搜索产生冲突的包(通常转到repository/org)并删除它
  • Try again to install it
  • 再次尝试安装它

With that you force to get the actual files

这样,您就必须获得实际的文件

good luck with that!

祝你好运吧!

#3


18  

Try to remove your repository in /.m2/repository/ and then do a mvn clean install to download the files again.

尝试在/中删除存储库。然后进行mvn清理安装,再次下载文件。

#4


5  

  1. go to the .m2/repository and delete the conflicting files
  2. 到.m2/repository删除冲突文件
  3. mvn -U clean install
  4. mvn - u全新安装

#5


4  

I had a similar problem as well. The fix was a mix of both. I had a problem with asm-3.1 (as mentioned in the blog post linked by Takahiko. That jar was corrupt. I needed to manually get the jar from the maven central repository. Removing it and retrying just got the corrupt jar again. It then still failed on the asm-parent, which was a POM file containing the HTML with a 301. Again, it required manually getting the file myself. You may want to check what settings XML to see if you're set to a different repository, such as a local nexus server.

我也有类似的问题。这两者兼而有之。我有一个asm-3.1的问题(正如Takahiko在博客中提到的那样)。jar是腐败。我需要从maven中心存储库手动获取jar。把它拿掉,再试一遍,又得到了那个坏罐子。然后,它在asn -parent上仍然失败,这是一个包含301 HTML的POM文件。同样,它需要我自己手动获取文件。您可能需要检查设置XML的设置,以查看是否设置了不同的存储库,比如本地的nexus服务器。

When the proper way to get the new one fails, manually grab it yourself.

当正确的获取新方法失败时,自己手动获取它。

#6


4  

This error can occur when your connection gets interrupted during your dependencies are being downloaded. Delete the relevant repository folder and run following command again to download a fresh copy of corrupted file.

在下载依赖项期间,当连接被中断时,可能会发生此错误。删除相关的存储库文件夹并再次运行以下命令以下载已损坏文件的新副本。

mvn clean install 

#7


3  

I had the same problem but previous solutions not work for me. The only solution works for me is the following URL.

我也遇到过同样的问题,但以前的解决方案对我来说行不通。唯一适合我的解决方案是下面的URL。

https://enlightensoft.wordpress.com/2013/01/15/maven-error-reading-error-in-opening-zip-file/

https://enlightensoft.wordpress.com/2013/01/15/maven-error-reading-error-in-opening-zip-file/

[EDIT]

(编辑)

Here I explain more about it

在这里我将对此做更多的解释

Suppose you got an error like below

假设您有如下错误。

[ERROR] error: error reading C:\Users\user\.m2\repository\org\jdom\jdom\1.1\jdom-1.1.jar; error in opening zip file

Then you have to follow these steps.

然后你必须遵循这些步骤。

  1. First, delete the existing jar C:\Users\user\.m2\repository\org\jdom\jdom\1.1\jdom-1.1.jar
  2. 首先,删除现有的jar C:\Users\user\.m2\repository\org\jdom\jdom\1.1\ jdom-1.1.jar
  3. Then you have to manually download relevant jar from Maven central repository. You can download from this link here
  4. 然后,您必须从Maven中央存储库手动下载相关的jar。你可以从这里下载。
  5. After that, you have to copy that downloaded jar into the previous directory.C:\Users\user\.m2\repository\org\jdom\jdom\1.1\
  6. 之后,您必须将下载的jar拷贝到先前的目录中

Then you can build your project using mvn clean install

然后可以使用mvn clean安装构建项目

hope this will help somebody.

希望这能对某人有所帮助。

#8


1  

I also encountered the same problem, my problem has been resolved. The solution is:

我也遇到了同样的问题,我的问题已经解决。解决方案是:

According to error information being given, to find the corresponding jar in maven repository and deleted. Then executed mvn install command after deleting.

根据给出的错误信息,在maven存储库中找到相应的jar并删除。然后在删除后执行mvn安装命令。

#9


0  

Accidently I found a simple workaroud to this issue. Running Maven with -X option forces it to try other servers to download source code. Instead of trash HTML inside some jar files there is correct content.

我无意中发现这个问题很简单。使用-X选项运行Maven将迫使它尝试其他服务器下载源代码。有些jar文件中没有垃圾HTML,而是有正确的内容。

mvn clean install -X > d:\log.txt

And in the log file you find messages like these:

在日志文件中,你可以找到这样的消息:

Downloading: https://repository.apache.org/content/groups/public/org/apache/axis2/mex/1.6.1-wso2v2/mex-1.6.1-wso2v2-impl.jar
[DEBUG] Writing resolution tracking file D:\wso2_local_repository\org\apache\axis2\mex\1.6.1-wso2v2\mex-1.6.1-wso2v2-impl.jar.lastUpdated
Downloading: https://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/axis2/mex/1.6.1-wso2v2/mex-1.6.1-wso2v2-impl.jar

You see, Maven switched repository.apache.org to maven.wso2.org when it encountered a download problem. So the following error is now gone:

当Maven遇到下载问题时,它将repository.apache.org切换到maven.wso2.org。所以下面的错误现在消失了:

[ERROR] error: error reading D:\wso2_local_repository\org\apache\axis2\mex\1.6.1-wso2v2\mex-1.6.1-wso2v2-impl.jar; error in opening zip file

#10


0  

For me I should change the .m2 repo in the settings.xml file with another one because in Mac maven can't create a folder that start with point(.)

对于我来说,我应该在设置中修改。m2回购。使用另一个xml文件是因为在Mac maven中不能创建以point()开头的文件夹。

to solve that, open your maven/version/conf/settings.xml and specify the location of your repo folder like this :

要解决这个问题,请打开maven/version/conf/settings。xml并指定repo文件夹的位置,如下所示:

<localRepository>../repo</localRepository>

don't forget to change it also in your IDE, in eclipse go to : Windows > Preferences > Maven > User Settings > Global Settings, and navigate to your settings.xml.

不要忘记在IDE中修改它,在eclipse中,转到:Windows >首选项> Maven >用户设置>全局设置,导航到settings.xml。

clean install your project.

全新安装您的项目。

hope this will help you.

希望这能对你有所帮助。

#11


0  

  1. I deleted the jar downloaded by maven
  2. 我删除了maven下载的jar。
  3. manually download the jar from google
  4. 从谷歌手动下载jar
  5. place the jar in the local repo in place of deleted jar.
  6. 将jar放在本地的repo中,代替已删除的jar。

This resolved my problem.

这解决了我的问题。

Hope it helps

希望它能帮助


.1\jdom-1.1.jar; error in opening zip file [ERROR] error: error reading C:\Users\suresh\.m2\repository\javax\servlet\servlet-api.5\servlet-api-2.5.jar; error in opening zip file [ERROR] error: error reading C:\Users\suresh\.m2\repository\org\apache\cxf\cxf-rt-bindings-http.2.1\cxf-rt-bindings-http-2.2.1.jar; error in opening zip file [ERROR] error: error reading C:\Users\suresh\.m2\repository\org\codehaus\jra\jra
[ERROR] error: error reading C:\Users\suresh\.m2\repository\org\jdom\jdom\1.1\jdom-1.1.jar; error in opening zip file
[ERROR] error: error reading C:\Users\suresh\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar; error in opening zip file
[ERROR] error: error reading C:\Users\suresh\.m2\repository\org\apache\cxf\cxf-rt-bindings-http\2.2.1\cxf-rt-bindings-http-2.2.1.jar; error in opening zip file
[ERROR] error: error reading C:\Users\suresh\.m2\repository\org\codehaus\jra\jra\1.0-alpha-4\jra-1.0-alpha-4.jar; error in opening zip file
[ERROR] error: error reading C:\Users\suresh\.m2\repository\org\apache\cxf\cxf-api\2.2.1\cxf-api-2.2.1.jar; error in opening zip file
[ERROR] error: error reading C:\Users\suresh\.m2\repository\org\apache\cxf\cxf-common-utilities\2.2.1\cxf-common-utilities-2.2.1.jar; error in opening zip file
[INFO] 44 errors

How to resolve this error while running mvn clean install?

如何在运行mvn清理安装时解决此错误?

And I see that, on to the repository path in my disk, starting from servlet, no packages are being created inside repository.

我看到,在我的磁盘的存储库路径上,从servlet开始,在存储库中没有创建包。

11 个解决方案

#1


58  

Probably, contents of the JAR files in your local .m2 repository are HTML saying "301 Moved Permanently". It seems that mvn does not handle "301 Moved Permanently" properly as expected. In such a case, download the JAR files manually from somewhere (the central repository, for example) and put them into your .m2 repository.

可能,本地.m2存储库中的JAR文件的内容是HTML,表示“301永久移动”。mvn似乎没有按照预期正确处理“301永久转移”。在这种情况下,从某个地方(例如中央存储库)手动下载JAR文件,并将它们放入您的.m2存储库中。

See also:

参见:

asm-3.1.jar; error in opening zip file
https://darutk-oboegaki.blogspot.jp/2012/07/asm-31jar-error-in-opening-zip-file.html

asm-3.1.jar;打开zip文件https://darutk- oboegaki.blogspot.jp2/7/asm -31jar-error- open -zip-file.html时出错

#2


38  

This error sometimes occurs. The files becomes corrupt. A quick solution thats works for me, is:

有时会发生这个错误。文件变得腐败。一个对我有效的快速解决方案是:

  • Go to your local repository (in general /.m2/) in your case I see that is C:\Users\suresh.m2)
  • 去你的本地存储库(一般/ .m2 /)在你的情况中我看到C:\Users\ suresh.m2)
  • Search for the packages that makes conflicts (in general go to repository/org) and delete it
  • 搜索产生冲突的包(通常转到repository/org)并删除它
  • Try again to install it
  • 再次尝试安装它

With that you force to get the actual files

这样,您就必须获得实际的文件

good luck with that!

祝你好运吧!

#3


18  

Try to remove your repository in /.m2/repository/ and then do a mvn clean install to download the files again.

尝试在/中删除存储库。然后进行mvn清理安装,再次下载文件。

#4


5  

  1. go to the .m2/repository and delete the conflicting files
  2. 到.m2/repository删除冲突文件
  3. mvn -U clean install
  4. mvn - u全新安装

#5


4  

I had a similar problem as well. The fix was a mix of both. I had a problem with asm-3.1 (as mentioned in the blog post linked by Takahiko. That jar was corrupt. I needed to manually get the jar from the maven central repository. Removing it and retrying just got the corrupt jar again. It then still failed on the asm-parent, which was a POM file containing the HTML with a 301. Again, it required manually getting the file myself. You may want to check what settings XML to see if you're set to a different repository, such as a local nexus server.

我也有类似的问题。这两者兼而有之。我有一个asm-3.1的问题(正如Takahiko在博客中提到的那样)。jar是腐败。我需要从maven中心存储库手动获取jar。把它拿掉,再试一遍,又得到了那个坏罐子。然后,它在asn -parent上仍然失败,这是一个包含301 HTML的POM文件。同样,它需要我自己手动获取文件。您可能需要检查设置XML的设置,以查看是否设置了不同的存储库,比如本地的nexus服务器。

When the proper way to get the new one fails, manually grab it yourself.

当正确的获取新方法失败时,自己手动获取它。

#6


4  

This error can occur when your connection gets interrupted during your dependencies are being downloaded. Delete the relevant repository folder and run following command again to download a fresh copy of corrupted file.

在下载依赖项期间,当连接被中断时,可能会发生此错误。删除相关的存储库文件夹并再次运行以下命令以下载已损坏文件的新副本。

mvn clean install 

#7


3  

I had the same problem but previous solutions not work for me. The only solution works for me is the following URL.

我也遇到过同样的问题,但以前的解决方案对我来说行不通。唯一适合我的解决方案是下面的URL。

https://enlightensoft.wordpress.com/2013/01/15/maven-error-reading-error-in-opening-zip-file/

https://enlightensoft.wordpress.com/2013/01/15/maven-error-reading-error-in-opening-zip-file/

[EDIT]

(编辑)

Here I explain more about it

在这里我将对此做更多的解释

Suppose you got an error like below

假设您有如下错误。

[ERROR] error: error reading C:\Users\user\.m2\repository\org\jdom\jdom\1.1\jdom-1.1.jar; error in opening zip file

Then you have to follow these steps.

然后你必须遵循这些步骤。

  1. First, delete the existing jar C:\Users\user\.m2\repository\org\jdom\jdom\1.1\jdom-1.1.jar
  2. 首先,删除现有的jar C:\Users\user\.m2\repository\org\jdom\jdom\1.1\ jdom-1.1.jar
  3. Then you have to manually download relevant jar from Maven central repository. You can download from this link here
  4. 然后,您必须从Maven中央存储库手动下载相关的jar。你可以从这里下载。
  5. After that, you have to copy that downloaded jar into the previous directory.C:\Users\user\.m2\repository\org\jdom\jdom\1.1\
  6. 之后,您必须将下载的jar拷贝到先前的目录中

Then you can build your project using mvn clean install

然后可以使用mvn clean安装构建项目

hope this will help somebody.

希望这能对某人有所帮助。

#8


1  

I also encountered the same problem, my problem has been resolved. The solution is:

我也遇到了同样的问题,我的问题已经解决。解决方案是:

According to error information being given, to find the corresponding jar in maven repository and deleted. Then executed mvn install command after deleting.

根据给出的错误信息,在maven存储库中找到相应的jar并删除。然后在删除后执行mvn安装命令。

#9


0  

Accidently I found a simple workaroud to this issue. Running Maven with -X option forces it to try other servers to download source code. Instead of trash HTML inside some jar files there is correct content.

我无意中发现这个问题很简单。使用-X选项运行Maven将迫使它尝试其他服务器下载源代码。有些jar文件中没有垃圾HTML,而是有正确的内容。

mvn clean install -X > d:\log.txt

And in the log file you find messages like these:

在日志文件中,你可以找到这样的消息:

Downloading: https://repository.apache.org/content/groups/public/org/apache/axis2/mex/1.6.1-wso2v2/mex-1.6.1-wso2v2-impl.jar
[DEBUG] Writing resolution tracking file D:\wso2_local_repository\org\apache\axis2\mex\1.6.1-wso2v2\mex-1.6.1-wso2v2-impl.jar.lastUpdated
Downloading: https://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/axis2/mex/1.6.1-wso2v2/mex-1.6.1-wso2v2-impl.jar

You see, Maven switched repository.apache.org to maven.wso2.org when it encountered a download problem. So the following error is now gone:

当Maven遇到下载问题时,它将repository.apache.org切换到maven.wso2.org。所以下面的错误现在消失了:

[ERROR] error: error reading D:\wso2_local_repository\org\apache\axis2\mex\1.6.1-wso2v2\mex-1.6.1-wso2v2-impl.jar; error in opening zip file

#10


0  

For me I should change the .m2 repo in the settings.xml file with another one because in Mac maven can't create a folder that start with point(.)

对于我来说,我应该在设置中修改。m2回购。使用另一个xml文件是因为在Mac maven中不能创建以point()开头的文件夹。

to solve that, open your maven/version/conf/settings.xml and specify the location of your repo folder like this :

要解决这个问题,请打开maven/version/conf/settings。xml并指定repo文件夹的位置,如下所示:

<localRepository>../repo</localRepository>

don't forget to change it also in your IDE, in eclipse go to : Windows > Preferences > Maven > User Settings > Global Settings, and navigate to your settings.xml.

不要忘记在IDE中修改它,在eclipse中,转到:Windows >首选项> Maven >用户设置>全局设置,导航到settings.xml。

clean install your project.

全新安装您的项目。

hope this will help you.

希望这能对你有所帮助。

#11


0  

  1. I deleted the jar downloaded by maven
  2. 我删除了maven下载的jar。
  3. manually download the jar from google
  4. 从谷歌手动下载jar
  5. place the jar in the local repo in place of deleted jar.
  6. 将jar放在本地的repo中,代替已删除的jar。

This resolved my problem.

这解决了我的问题。

Hope it helps

希望它能帮助


.0-alpha-4\jra-1.0-alpha-4.jar; error in opening zip file [ERROR] error: error reading C:\Users\suresh\.m2\repository\org\apache\cxf\cxf-api.2.1\cxf-api-2.2.1.jar; error in opening zip file [ERROR] error: error reading C:\Users\suresh\.m2\repository\org\apache\cxf\cxf-common-utilities.2.1\cxf-common-utilities-2.2.1.jar; error in opening zip file [INFO] 44 errors [ERROR] error: error reading C:\Users\suresh\.m



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: