本文介绍了冬眠-公地注解-4.0.1.Final.jar;无效的LOC头(坏签名)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Maven的新手..我试图为springMVC + Hiberante创建maven项目,但是我收到了很多错误。任何人都可以解决我的问题,请检查我的pom.xml文件以下。

 <?xml version =1.0encoding =UTF-8?>< project> 
< modelVersion> 4.0.0< / modelVersion>
< groupId> Spring3HibernateMaven< / groupId>
< artifactId> Spring3HibernateMaven< / artifactId>
<包装>战争< / packaging>
< version> 0.0.1-SNAPSHOT< / version>
< description>< / description>
< build>
< plugins>
< plugin>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 2.3.2< / version>

<配置>
< source> 1.5< / source>
< target> 1.5< / target>
< / configuration>
< / plugin>

<! - < plugin>
< artifactId> maven-war-plugin< / artifactId>
< version> 2.0< / version>

< / plugin> - >
< / plugins>
< / build>
<依赖关系>
< dependency>
< groupId> javax.servlet< / groupId>
< artifactId> servlet-api< / artifactId>
< version> 2.5< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-beans< / artifactId>
< version> $ {org.springframework.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-jdbc< / artifactId>
< version> $ {org.springframework.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-web< / artifactId>
< version> $ {org.springframework.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-webmvc< / artifactId>
< version> $ {org.springframework.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-orm< / artifactId>
< version> $ {org.springframework.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-core< / artifactId>
< version> 4.1.9.Final< / version>
< /依赖关系>

< dependency>
< groupId> taglibs< / groupId>
< artifactId>标准< / artifactId>
< version> 1.1.2< / version>
< /依赖关系>
< dependency>
< groupId> javax.servlet< / groupId>
< artifactId> jstl< / artifactId>
< version> 1.1.2< / version>
< /依赖关系>
< dependency>
< groupId> mysql< / groupId>
< artifactId> mysql-connector-java< / artifactId>
< version> 5.1.10< / version>
< /依赖关系>
< dependency>
< groupId> commons-dbcp< / groupId>
< artifactId> commons-dbcp< / artifactId>
< version> 20030825.184428< / version>
< /依赖关系>
< dependency>
< groupId> commons-pool< / groupId>
< artifactId> commons-pool< / artifactId>
< version> 20030825.183949< / version>
< /依赖关系>

< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-api< / artifactId>
< version> 1.7.5< / version>
< /依赖关系>

< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-simple< / artifactId>
< version> 1.6.4< / version>
< /依赖关系>

< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-log4j12< / artifactId>
< version> 1.7.5< / version>
< /依赖关系>
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-annotations< / artifactId>
< version> 3.4.0.GA< / version>
< /依赖关系>

< /依赖关系>
<属性>
< org.springframework.version> 3.0.2.RELEASE< /org.springframework.version>
< project.build.sourceEncoding> UTF-8< /project.build.sourceEncoding>
< / properties>
< / project>

但我收到以下错误:

  [INFO] ------------------------------------- ----------------------------------- 
[错误]未能执行目标org.apache。编译失败:编译失败:
[错误]错误:错误读取C:\ Users \ Bhanu\\ \\.m2\repository\commons-logging\commons-logging\1.1.1\commons-测井1.1.1.jar;无效的LOC标头(坏签名)
[错误]错误:读取错误C:\ Users \Bhanu\.m2\repository\org\hibernate\hibernate-core\4.1.9。 Final\hibernate核心 - 4.1.9.Final.jar;无效的LOC头(错误签名)
[错误]错误:读取错误C:\ Users \Bhanu\.m2\repository\antlr\antlr\2.7.7\antlr-2.7。 7.jar;无效的LOC头(错误签名)
[错误]错误:读取错误C:\ Users \Bhanu\.m2\repository\org\jboss\logging\jboss-logging\3.1 .0.GA\jboss-测井3.1.0.GA.jar;无效的LOC标头(坏签名)
[错误]错误:读取错误C:\ Users \Bhanu\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6。 1.jar;无效的LOC头(坏签名)
[错误]错误:错误读取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;无效LOC标头(错误签名)
[错误]错误:读取错误C:\ Users \Bhanu\.m2\repository\org\hibernate\common\hibernate-commons-annotations\\ \\4.0.1.Final\hibernate-公地注解-4.0.1.Final.jar;无效的LOC头(坏签名)
[错误] - > [帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整的调试日志记录。
[错误]
[错误]有关错误和可能解决方案的更多信息,请阅读以下文章:
[错误] [帮助1] http://cwiki.apache.org / confluence / display / MAVEN / MojoFailureException

任何人都可以帮助我解决问题。
我使用 apache-maven-3.2.1 + Java1.6 + ecpliseIndigo

解决方案

这看起来像是一个腐败的罐子被下载的问题。我只有在使用eclipse时才会看到这种情况。以下是我为解决这个问题所做的一切:


  • 从C:\Users\Bhanu.m2\repository中删除内容。无论是一切还是有选择性的 - 您的选择。
  • 然后使用命令提示符强制下载jar和build


      mvn干净安装



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
    

这篇关于冬眠-公地注解-4.0.1.Final.jar;无效的LOC头(坏签名)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 17:57