maven install throw “error in opening zip file” only after the second try

后端 未结 4 1567
囚心锁ツ
囚心锁ツ 2021-02-15 14:40

I try to run maven install on my project with some dependencies:


    log4j
    log4j

        
相关标签:
4条回答
  • 2021-02-15 15:02

    step1.

    Clean your .m2\repository or delete your specific folders from the .m2\repository directory

    step2.

    run mvn clean install

    step3.

    be sure that your internet connection is working fine at the time of running this command, some times it fails due to connection problems.

    0 讨论(0)
  • 2021-02-15 15:09

    It seems to be due to an incorrect connection url in your maven plugin. I was using a vpn connection earlier and hence, it had initialized it with that url which was not valid anymore.

    rm -rf {PATH to .m2}/repository/org/apache/maven/plugins/

    This should fix it

    0 讨论(0)
  • 2021-02-15 15:11

    I was facing the same issue just now. Changing maven compiler plugin version to 3.1 helped.

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    
    0 讨论(0)
  • 2021-02-15 15:21

    In my case It was giving below error

    error: error reading C:\Users\ppatel4.m2\repository\org\apache\xalan\xalan\2.7. 1\xalan-2.7.1.jar; error in opening zip file

    Below are the steps I did to fix it.

    1. Manually download xalan-2.7.1.jar
    2. Remove all files of: ~/.m2/repository/org/apache/xalan/xalan/2.7.1/
    3. Copy the jar which is manually downloaded into the location: ~/.m2/repository/org/apache/xalan/xalan/2.7.1/

    $ cp xalan-2.7.1.jar ~/.m2/repository/org/apache/xalan/xalan/2.7.1/
    

    Its Done… Try to execute your mvn clean install command.

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