Maven : error in opening zip file when running maven

后端 未结 17 2180
-上瘾入骨i
-上瘾入骨i 2020-11-29 03:28
[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         


        
相关标签:
17条回答
  • 2020-11-29 03:52

    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.

    0 讨论(0)
  • 2020-11-29 03:53

    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 
    
    0 讨论(0)
  • 2020-11-29 03:54
    1. go to the .m2/repository and delete the conflicting files
    2. mvn -U clean install
    0 讨论(0)
  • 2020-11-29 03:54

    I just have this error. You can delete the files and run the compiling command again:

    $ sudo rm /Users/Chaklader/.m2/repository/org/apache/poi/poi/3.17/poi-3.17.jar
    $ sudo rm /Users/Chaklader/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.7.5/jackson-databind-2.7.5.jar
    $ sudo rm /Users/Chaklader/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.7.5/jackson-core-2.7.5.jar
    

    Now, run the command for the clean compile:

    $ mvn -U clean compile
    
    0 讨论(0)
  • 2020-11-29 03:55

    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

    [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. Then you have to manually download relevant jar from Maven central repository. You can download from this link here
    3. After that, you have to copy that downloaded jar into the previous directory.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.

    0 讨论(0)
  • 2020-11-29 03:56
    1. I deleted the jar downloaded by maven
    2. manually download the jar from google
    3. place the jar in the local repo in place of deleted jar.

    This resolved my problem.

    Hope it helps

    0 讨论(0)
提交回复
热议问题