I have a java jersey spring based maven application. I imported into my Eclipse, and when Maven starts downloading all dependencies (jars), they are all corrupted with very low sized files(<10kb). I deleted the .m2 repo and ran the mvn clean install command multiple times, but I still get the same corrupted files.
Is there something wrong with pom.xml? Below is my pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.kreator.rest</groupId>
<artifactId>kreatorRestServices</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>kreatorRestServices Maven Webapp</name>
<!-- FIXME change it to the project's website -->
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>codelds</id>
<url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
<repository>
<id>maven2-repository.java.nettt</id>
<url>https://mvnrepository.com/artifact/org.glassfish.jersey.ext/jersey-spring3</url>
</repository>
</repositories>
<!-- Specifying the Versions of Spring, Hiberante, MySQL etc -->
<properties>
<hibernate.version>4.3.8.Final</hibernate.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.velocity/velocity -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.11</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-spring3</artifactId>
<version>2.11</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.2.RELEASE</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.11</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.11</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc5</artifactId>
<version>11.2.0.2.0</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>kreatorRestServices</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<version>2.0.3</version>
<configuration>
<appName>kreatorbackendservices</appName>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.github.jsimone</groupId>
<artifactId>webapp-runner</artifactId>
<version>9.0.30.0</version>
<destFileName>webapp-runner.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
And the error I see (when i run the build):
[WARNING] The POM for commons-lang:commons-lang:jar:2.6 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.velocity:velocity:jar:1.7 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.postgresql:postgresql:jar:42.2.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for commons-logging:commons-logging:jar:1.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.springframework:spring-orm:jar:4.3.2.RELEASE is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for javax.persistence:javax.persistence-api:jar:2.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.fasterxml.jackson.core:jackson-core:jar:2.5.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
.
.
.
.
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 38 source files to C:\Users\charrj\Documents\kreatorjavatoolservices\target\classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /C:/Users/charrj/Documents/kreatorjavatoolservices/src/main/java/com/pojo/Screen.java: Some input files use unchecked or unsafe operations.
[WARNING] /C:/Users/charrj/Documents/kreatorjavatoolservices/src/main/java/com/pojo/Screen.java: Recompile with -Xlint:unchecked for details.
[INFO] 2 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error reading C:\Users\charrj\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\apache\velocity\velocity\1.7\velocity-1.7.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\postgresql\postgresql\42.2.1\postgresql-42.2.1.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-orm\4.3.2.RELEASE\spring-orm-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\javax\persistence\javax.persistence-api\2.2\javax.persistence-api-2.2.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.5.0\jackson-core-2.5.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.5.0\jackson-databind-2.5.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.5.0\jackson-annotations-2.5.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\glassfish\jersey\core\jersey-server\2.11\jersey-server-2.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\glassfish\jersey\ext\jersey-spring3\2.11\jersey-spring3-2.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\glassfish\jersey\media\jersey-media-json-jackson\2.22.2\jersey-media-json-jackson-2.22.2.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-core\4.3.2.RELEASE\spring-core-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-beans\4.3.2.RELEASE\spring-beans-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-context\4.3.2.RELEASE\spring-context-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-web\4.3.2.RELEASE\spring-web-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-context-support\4.3.2.RELEASE\spring-context-support-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-aop\4.3.2.RELEASE\spring-aop-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\aspectj\aspectjrt\1.6.11\aspectjrt-1.6.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\aspectj\aspectjweaver\1.6.11\aspectjweaver-1.6.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-jdbc\4.3.2.RELEASE\spring-jdbc-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\oracle\ojdbc5\11.2.0.2.0\ojdbc5-11.2.0.2.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\hibernate\hibernate-core\4.3.8.Final\hibernate-core-4.3.8.Final.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\hibernate\hibernate-c3p0\4.3.8.Final\hibernate-c3p0-4.3.8.Final.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\apache\velocity\velocity\1.7\velocity-1.7.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\postgresql\postgresql\42.2.1\postgresql-42.2.1.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-orm\4.3.2.RELEASE\spring-orm-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\javax\persistence\javax.persistence-api\2.2\javax.persistence-api-2.2.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.5.0\jackson-core-2.5.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.5.0\jackson-databind-2.5.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.5.0\jackson-annotations-2.5.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\glassfish\jersey\core\jersey-server\2.11\jersey-server-2.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\glassfish\jersey\ext\jersey-spring3\2.11\jersey-spring3-2.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\glassfish\jersey\media\jersey-media-json-jackson\2.22.2\jersey-media-json-jackson-2.22.2.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-core\4.3.2.RELEASE\spring-core-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-beans\4.3.2.RELEASE\spring-beans-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-context\4.3.2.RELEASE\spring-context-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-web\4.3.2.RELEASE\spring-web-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-context-support\4.3.2.RELEASE\spring-context-support-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-aop\4.3.2.RELEASE\spring-aop-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\aspectj\aspectjrt\1.6.11\aspectjrt-1.6.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\aspectj\aspectjweaver\1.6.11\aspectjweaver-1.6.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-jdbc\4.3.2.RELEASE\spring-jdbc-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\oracle\ojdbc5\11.2.0.2.0\ojdbc5-11.2.0.2.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\hibernate\hibernate-core\4.3.8.Final\hibernate-core-4.3.8.Final.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\hibernate\hibernate-c3p0\4.3.8.Final\hibernate-c3p0-4.3.8.Final.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar; error in opening zip file
Any help will be much appreciated. I can't go and download jars manually, because I'm trying to deploy the app on Heroku as well, so that anyway will try to download the files again. So it is not just my local .m2 repo alone that's affected because of this.
Related
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 below
<?xml version="1.0" encoding="UTF-8"?><project>
<modelVersion>4.0.0</modelVersion>
<groupId>Spring3HibernateMaven</groupId>
<artifactId>Spring3HibernateMaven</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<description></description>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<!-- <plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
</plugin> -->
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.9.Final</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.10</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>20030825.184428</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>20030825.183949</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
</dependencies>
<properties>
<org.springframework.version>3.0.2.RELEASE</org.springframework.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
but I am getting the following errors
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project Spring3HibernateMaven: Compilation failure: Compilation failure:
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\org\hibernate\hibernate-core\4.1.9.Final\hibernate-core-4.1.9.Final.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\org\jboss\logging\jboss-logging\3.1.0.GA\jboss-logging-3.1.0.GA.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\org\hibernate\javax\persistence\hibernate-jpa-2.0-api\1.0.1.Final\hibernate-jpa-2.0-api-1.0.1.Final.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\org\hibernate\common\hibernate-commons-annotations\4.0.1.Final\hibernate-commons-annotations-4.0.1.Final.jar; invalid LOC header (bad signature)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Can Any one help me how to resolve my problem .
I am using apache-maven-3.2.1 +Java1.6+ecpliseIndigo
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
I will tell you what I did
I was getting the same error in common-logging so I went to C:\Users\admin.m2\repository\commons-logging and deleted the directory. The problem was solved next time I compiled.
It Throw Because your hibernate-commons-annotations-4.0.1.Final.jar is Invalid Or Corrupted.
Follow the Steps:
Note : .m2 Folder is Hidden by Default. UnHide the Folder.
Step 1:Delete all the Content in .m2/repository Folder.
Step 2:Restart Your Eclipse.
Step 3:Maven->Update Project .Checked- Force Update of Snapshots/Releases.
Step 4:Run as Maven Clean.
Step 5:Run as Maven Install.
Step 6: Clean Project.
Step 7 : Run Your Project.
I Hope you Find your Solution Here..
Thanks..
The reason is a corrupt jar file.
Use mvn dependency:purge-local-repository to delete und reload your dependencies in your local maven repository.
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.
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!
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.
Another option is to instead of deleting the repo add a new one, update Maven settings file - <localRepository>C:\\repos\\mycustomrepo</localRepository>
This can be useful if your working between on different unrelated projects - as was my case. #Vinay Rao answer pointed me in direction of creating a custom repo.
I was getting the same problem.So I had update my maven library and it worked for me.
Nagivate to your C:\Users\user.m2\repository\projects\project1
Pick the corresponding project and delete it from your .m2. Then f you use maven do mvn clean install otherwise build it accordingly in the terminal. it will recreate those jar files for you Reinstall the ear or war file in server and it should deploy just fine now.
It worked for me.
In the above case delete the commons-logging-1.1.1.jar from .m2/repository/ folder and then just run maven-install, It will definitely be successful.
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
I'm trying to setup SonarQube (v.4.5.6) with maven support. I believe my configuration is correct but I can't get SonarQube analysis to run without errors.
My project's dependencies:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-ldap</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>${logstash-logback-encoder.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<version>${spring-security-test.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
sonar-maven-plugin:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.7.1</version>
</plugin>
SonarQube analysis throws the following errors:
[INFO] [19:07:06.235] Source paths: pom.xml, src/main/java
[INFO] [19:07:06.235] Test paths: src/test/java
[INFO] [19:07:06.235] Binary dirs: target/classes
[INFO] [19:07:08.046] Sensor JavaSquidSensor...
[INFO] [19:07:08.154] Configured Java source version: none
[INFO] [19:07:08.157] JavaClasspath initialization...
[INFO] [19:07:08.173] JavaClasspath initialization done: 16 ms
[INFO] [19:07:08.173] JavaTestClasspath initialization...
[INFO] [19:07:08.202] JavaTestClasspath initialization done: 29 ms
[INFO] [19:07:08.412] Java Main Files AST scan...
[INFO] [19:07:08.414] 27 source files to be analyzed
[ERROR] [19:07:08.849] Class not found: org.springframework.security.openid.OpenIDAuthenticationFilter
[ERROR] [19:07:08.850] Class not found: org.springframework.security.openid.OpenIDConsumer
[ERROR] [19:07:08.850] Class not found: org.openid4java.consumer.ConsumerManager
[ERROR] [19:07:08.850] Class not found: org.springframework.security.openid.OpenIDAuthenticationToken
[ERROR] [19:07:08.851] Class not found: org.openid4java.consumer.ConsumerException
[ERROR] [19:07:08.851] Class not found: org.springframework.security.openid.AxFetchListFactory
[ERROR] [19:07:08.872] Class not found: org.springframework.jdbc.datasource.init.DatabasePopulator
[ERROR] [19:07:08.872] Class not found: org.springframework.jdbc.datasource.init.DataSourceInitializer
[ERROR] [19:07:09.798] Class not found: javax.annotation.Nullable
[INFO] [19:07:10.163] 27/27 source files have been analyzed
[INFO] [19:07:10.163] Java Main Files AST scan done: 1751 ms
[INFO] [19:07:10.165] Java bytecode scan...
[INFO] [19:07:10.238] Java bytecode scan done: 73 ms
[INFO] [19:07:10.239] Java Test Files AST scan...
[INFO] [19:07:10.239] 17 source files to be analyzed
[ERROR] [19:07:10.400] Class not found: org.springframework.security.openid.OpenIDAuthenticationFilter
[ERROR] [19:07:10.400] Class not found: org.springframework.security.openid.OpenIDConsumer
[ERROR] [19:07:10.401] Class not found: org.openid4java.consumer.ConsumerManager
[ERROR] [19:07:10.401] Class not found: org.springframework.security.openid.OpenIDAuthenticationToken
[ERROR] [19:07:10.401] Class not found: org.openid4java.consumer.ConsumerException
[ERROR] [19:07:10.401] Class not found: org.springframework.security.openid.AxFetchListFactory
[INFO] [19:07:11.114] Java Test Files AST scan done: 875 ms
[INFO] [19:07:11.114] 17/17 source files have been analyzed
All mentioned classes are not used in project, which I for me makes more confusing what could be wrong.
You can see that the analysis run until the end without saying it failed. The analysis succeed.
What this message ´Class not found:´ means ?
This is raised by sonarqube java analyzer when it analyzes the dependency of a source file. For instance, if you extends a class from spring, sonarqube java analyzer will look for the corresponding .class file.
If we have a rule that will count the number of hierarchy level, it will then look for the dependency of this .class file and so on. Meaning it will look for some classes that might not be directly in your project.
This message is harmless, it just warns you that the analyzer was not able to find some .class files so you might end up with less accurate results and/or you might want to fix the classpath provided to the analysis.
I have been trying to build a code using maven. But I am stuck with an error.
My system configurations as shown by maven is followning:
Apache Maven 3.0.2 (r1056850; 2011-01-09 07:58:10+0700)
Java version: 1.7.0_05, vendor: Oracle Corporation
Java home: /home/bhphuc/soft/jdk1.7.0_05/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.11.0-15-generic", arch: "amd64", family: "unix"
Following is the Maven trace for the error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project SpringExample: Compilation failure: Compilation failure:
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[3,24] error: package javax.persistence does not exist
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[4,24] error: package javax.persistence does not exist
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[5,24] error: package javax.persistence does not exist
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[6,31] error: package javax.persistence does not exist
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[6,0] error: static import only from classes and interfaces
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[7,24] error: package javax.persistence does not exist
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[8,24] error: package javax.persistence does not exist
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[9,24] error: package javax.persistence does not exist
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[11,1] error: cannot find symbol
[ERROR] class Entity
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[12,1] error: cannot find symbol
[ERROR] class Table
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[29,2] error: cannot find symbol
[ERROR] class Stock
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[30,2] error: cannot find symbol
[ERROR] class Stock
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[31,2] error: cannot find symbol
[ERROR] class Stock
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[40,2] error: cannot find symbol
[ERROR] class Stock
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[49,2] error: cannot find symbol
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
the pom.xml file.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mkyong.common</groupId>
<artifactId>SpringExample</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>SpringExample</name>
<url>http://maven.apache.org</url>
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
</properties>
<dependencies>
<!-- JUnit testing framework -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- Spring framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring AOP dependency -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2</version>
</dependency>
<!-- MySQL database driver -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
<!-- Hibernate framework -->
<dependency>
<groupId>hibernate</groupId>
<artifactId>hibernate3</artifactId>
<version>3.2.3.GA</version>
</dependency>
<!-- Hibernate annotation -->
<dependency>
<groupId>hibernate-annotations</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.0.GA</version>
</dependency>
<dependency>
<groupId>hibernate-commons-annotations</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.0.0.GA</version>
</dependency>
<!-- Hibernate library dependecy start -->
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
<!-- Hibernate library dependecy end -->
</dependencies>
</project>
the pom.xml fail ???
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
</dependency>
try to add this dependency in your pom file. Also had you noticed the error
[ERROR] /home/bhphuc/Axs/SpringHibernateAnnotationExample/src/main/java/com/mkyong/stock/model/Stock.java:[6,0] error: static import only from classes and interface
Did you used any static imports there (in Stock class) ?? Also please check your JDK version.
The pom.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.codehaus.sonar-plugins.java</groupId>
<artifactId>java</artifactId>
<version>2.3-SNAPSHOT</version>
</parent>
<artifactId>java-checks</artifactId>
<name>SonarQube Java :: Checks</name>
<dependencies>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-deprecated</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>java-squid</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.sonar.sslr</groupId>
<artifactId>sslr-testing-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
I've been trying to run this pom.xml on eclipse, and i kept having this error of:
[INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 2:22.878s [INFO] Finished at: Wed May 21 10:53:12
CST 2014 [INFO] Final Memory: 10M/61M [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal on project java-checks: Could not
resolve dependencies for project
org.codehaus.sonar-plugins.java:java-checks:jar:2.3-SNAPSHOT: The
following artifacts could not be resolved:
org.codehaus.sonar:sonar-deprecated:jar:4.2-RC1,
org.codehaus.sonar:sonar-plugin-api:jar:4.2-RC1,
org.codehaus.sonar:sonar-check-api:jar:4.2-RC1,
org.codehaus.sonar:sonar-colorizer:jar:4.2-RC1,
org.codehaus.sonar:sonar-graph:jar:4.2-RC1,
org.codehaus.sonar:sonar-squid:jar:4.2-RC1,
org.codehaus.sonar-plugins.java:java-squid:jar:2.3-SNAPSHOT: Could not
transfer artifact org.codehaus.sonar:sonar-deprecated:jar:4.2-RC1
from/to central (http://repo.maven.apache.org/maven2): No response
received after 60000 -> [Help 1] [ERROR] [ERROR] To see the full
stack trace of the errors, re-run Maven with the -e switch. [ERROR]
Re-run Maven using the -X switch to enable full debug logging. [ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles: [ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Is there anything i need to add to pom.xml?
It's all in the log:
No response received after 60000
Maven is trying to download dependencies for the plugins that you are using, and it's failing because of a timeout. Check your network connection and ensure you can access the Maven central repository (http://repo.maven.apache.org/maven2).
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 below
<?xml version="1.0" encoding="UTF-8"?><project>
<modelVersion>4.0.0</modelVersion>
<groupId>Spring3HibernateMaven</groupId>
<artifactId>Spring3HibernateMaven</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<description></description>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<!-- <plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
</plugin> -->
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.9.Final</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.10</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>20030825.184428</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>20030825.183949</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
</dependencies>
<properties>
<org.springframework.version>3.0.2.RELEASE</org.springframework.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
but I am getting the following errors
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project Spring3HibernateMaven: Compilation failure: Compilation failure:
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\org\hibernate\hibernate-core\4.1.9.Final\hibernate-core-4.1.9.Final.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\org\jboss\logging\jboss-logging\3.1.0.GA\jboss-logging-3.1.0.GA.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\org\hibernate\javax\persistence\hibernate-jpa-2.0-api\1.0.1.Final\hibernate-jpa-2.0-api-1.0.1.Final.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Users\Bhanu\.m2\repository\org\hibernate\common\hibernate-commons-annotations\4.0.1.Final\hibernate-commons-annotations-4.0.1.Final.jar; invalid LOC header (bad signature)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Can Any one help me how to resolve my problem .
I am using apache-maven-3.2.1 +Java1.6+ecpliseIndigo
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
I will tell you what I did
I was getting the same error in common-logging so I went to C:\Users\admin.m2\repository\commons-logging and deleted the directory. The problem was solved next time I compiled.
It Throw Because your hibernate-commons-annotations-4.0.1.Final.jar is Invalid Or Corrupted.
Follow the Steps:
Note : .m2 Folder is Hidden by Default. UnHide the Folder.
Step 1:Delete all the Content in .m2/repository Folder.
Step 2:Restart Your Eclipse.
Step 3:Maven->Update Project .Checked- Force Update of Snapshots/Releases.
Step 4:Run as Maven Clean.
Step 5:Run as Maven Install.
Step 6: Clean Project.
Step 7 : Run Your Project.
I Hope you Find your Solution Here..
Thanks..
The reason is a corrupt jar file.
Use mvn dependency:purge-local-repository to delete und reload your dependencies in your local maven repository.
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.
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!
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.
Another option is to instead of deleting the repo add a new one, update Maven settings file - <localRepository>C:\\repos\\mycustomrepo</localRepository>
This can be useful if your working between on different unrelated projects - as was my case. #Vinay Rao answer pointed me in direction of creating a custom repo.
I was getting the same problem.So I had update my maven library and it worked for me.
Nagivate to your C:\Users\user.m2\repository\projects\project1
Pick the corresponding project and delete it from your .m2. Then f you use maven do mvn clean install otherwise build it accordingly in the terminal. it will recreate those jar files for you Reinstall the ear or war file in server and it should deploy just fine now.
It worked for me.
In the above case delete the commons-logging-1.1.1.jar from .m2/repository/ folder and then just run maven-install, It will definitely be successful.
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