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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With