hibernate-commons-annotations-4.0.1.Final.jar;无效的 LOC 标头(错误的签名)? [英] hibernate-commons-annotations-4.0.1.Final.jar; invalid LOC header (bad signature)?
问题描述
我是 Maven 的新手..我正在尝试为 springMVC+Hiberante 创建 maven 项目,但我遇到了很多错误..有人可以解决我的问题吗,请检查我的 pom.xml 以了解以下内容
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>
但我收到以下错误
[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:UsersBhanu.m2
epositorycommons-loggingcommons-logging1.1.1commons-logging-1.1.1.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:UsersBhanu.m2
epositoryorghibernatehibernate-core4.1.9.Finalhibernate-core-4.1.9.Final.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:UsersBhanu.m2
epositoryantlrantlr2.7.7antlr-2.7.7.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:UsersBhanu.m2
epositoryorgjbossloggingjboss-logging3.1.0.GAjboss-logging-3.1.0.GA.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:UsersBhanu.m2
epositorydom4jdom4j1.6.1dom4j-1.6.1.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:UsersBhanu.m2
epositoryorghibernatejavaxpersistencehibernate-jpa-2.0-api1.0.1.Finalhibernate-jpa-2.0-api-1.0.1.Final.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:UsersBhanu.m2
epositoryorghibernatecommonhibernate-commons-annotations4.0.1.Finalhibernate-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
谁能帮我解决我的问题.我正在使用 apache-maven-3.2.1 +Java1.6+ecpliseIndigo
Can Any one help me how to resolve my problem . I am using apache-maven-3.2.1 +Java1.6+ecpliseIndigo
推荐答案
这看起来像是下载损坏的 jars 的问题.我只在使用 eclipse 时才看到这种情况发生.以下是我为解决此问题所做的工作:
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:
- 从 C:UsersBhanu.m2 epository 中删除内容.无论是一切还是有选择地 - 您的选择.
然后使用命令提示符强制下载jars并构建
- Delete contents from C:UsersBhanu.m2 epository. Either everything or selectively - your choice.
Then use the command prompt to force download jars and build
mvn clean install
这篇关于hibernate-commons-annotations-4.0.1.Final.jar;无效的 LOC 标头(错误的签名)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!