[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
?
And I see that, starting from servlet-api
, no packages are being created inside the local repository on my disk.
This resolved my problem.
Hope it helps
Try to remove your repository in
/.m2/repository/
and then do amvn clean install
to download the files again.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.
And in the log file you find messages like these:
You see, Maven switched repository.apache.org to maven.wso2.org when it encountered a download problem. So the following error is now gone:
I had the same problem but previous solutions not work for me. The only solution works for me is the following URL.
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
Then you have to follow these steps.
C:\Users\user\.m2\repository\org\jdom\jdom\1.1\jdom-1.1.jar
C:\Users\user\.m2\repository\org\jdom\jdom\1.1\
Then you can build your project using
mvn clean install
hope this will help somebody.
Deleting the entire local m2 repo may not be advisable. As in my case I have hundreds and hundreds of jars in my local, I don't want to re-download them all just for one jar. Most of the above answers didn't work for me, here is what I did.
STEP:1: Ensure if you are downloading from the correct Maven repo in you settings.xml. In my case it was referring to http://central.maven.org/maven2/ as https://repo1.maven.org/maven2/. So it was getting corrupted or going otherwise?
STEP:2: Delete the folder containing the artifact and other details in your local machine.This will force it download it again upon next build
STEP:3: mvn clean install :).
Hope it helps.
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.