hibernate-commons-annotations-4.0.1.Final.jar; invalid LOC header (bad signature)?

后端 未结 12 1036
野趣味
野趣味 2020-11-29 05:04

I am new for Maven ..I am trying to create maven project for springMVC+Hiberante but I am getting lot of errors..can any one slove my problem please check my pom.xml for be

相关标签:
12条回答
  • 2020-11-29 05:23

    This looks like a problem of corrupt jars being downloaded. I have seen this happen only when I use eclipse. Here's what I did to get rid of this problem:

    • Delete contents from C:\Users\Bhanu.m2\repository. Either everything or selectively - your choice.
    • Then use the command prompt to force download jars and build

      mvn clean install
      
    0 讨论(0)
  • 2020-11-29 05:24

    You have to remove all jars from your .m2 repository and run maven project again: if you have war already so you have to delete all jars and download again.

    • Delete contents from .m2\repository. from your directory

      mvn clean install
      
    0 讨论(0)
  • 2020-11-29 05:25

    It is important to remember that what is invalid is useless (e.g. corrupted), so:

    • Delete all JARs that have invalid signature. invalid means invalid.
    • Update Maven project, clean, install.
    • If you still get invalid LOC header - change repo and your ISP...

    I had similar problem and it had nothing to do with revisioning or Maven itself... The problem was corrupted JAR ( Eclipse with Maven plugin does not work with latest revisions, but works with older ones).

    Good luck!

    0 讨论(0)
  • 2020-11-29 05:28

    I was getting the same error while running the mvn clean install command

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project MongoModule: Compilation failure
    [ERROR] error: error reading /home/radium/.m2/repository/org/mongodb/mongo-java-driver/3.2.2/mongo-java-driver-3.2.2.jar; invalid LOC header (bad signature)
    [ERROR] -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project MongoModule: Compilation failure
    error: error reading /home/radium/.m2/repository/org/mongodb/mongo-java-driver/3.2.2/mongo-java-driver-3.2.2.jar; invalid LOC header (bad signature)
    

    Then I deleted the mongo-java-driver-3.2.2.jar file from the maven repo and re run the maven build command, which forced the maven to re download the jar and successfully build the project.

    0 讨论(0)
  • 2020-11-29 05:30

    I know this is an old thread, but I have faced the same problem (albeit with a different jar file).

    In eclipse, when a maven build fails because of corrupt LOC header, a warning is generated (in my case it was spring-tx-3.0.3.RELEASE.pom but could be any other maven dependancy).

    Go up in build stack-trace and figure out which JAR is failing, delete the corresponding repo folder from .m2 repositories and rebuild, that should do the trick.

    0 讨论(0)
  • 2020-11-29 05:33

    The reason is a corrupt jar file. Use mvn dependency:purge-local-repository to delete und reload your dependencies in your local maven repository.

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