Hibernate的Maven依赖项

时间:2012-01-07 23:57:38

标签: hibernate maven-3 spring-3 pom.xml

我需要在Spring上使用Hibernate,我试图弄清楚要使用的Maven依赖项,它不会太难,但不知怎的,我无法完成它。

在我正在开发的玩具应用程序中,我需要实现一些用户案例,这些用例是我在一年前或者两年前开发的,我使用了Hiebrnate 3.3.2.GA和Hibernate注释3.4.0.GA.所以我只需要我在项目中包含的相同的罐子而不使用maven。所以我在pom.xml文件中添加了以下内容:

<dependencies>
        ...
        <dependency>
           <groupId>org.hibernate</groupId>
           <artifactId>hibernate-core</artifactId>
           <version>3.3.2.GA</version>
        </dependency>
        <dependency>
           <groupId>org.hibernate</groupId>
           <artifactId>hibernate-annotations</artifactId>
           <version>3.4.0.GA</version>
        </dependency>
        <dependency>
           <groupId>org.hibernate</groupId>
           <artifactId>hibernate-commons-annotations</artifactId>
           <version>3.3.0.GA</version>
        </dependency>
        <dependency>
           <groupId>org.hibernate</groupId>
           <artifactId>hibernate-entitymanager</artifactId>
           <version>3.4.0.GA</version>
        </dependency> 
         <dependency>
          <groupId>log4j</groupId>
          <artifactId>log4j</artifactId>
          <version>1.2.15</version>
        </dependency>
       ... 
</dependencies>
    <repositories>  
        ...
        <repository>
            <id>JBoss</id>
            <name>JBoss Repsitory</name>
            <layout>default</layout>
            <url>http://repository.jboss.org/maven2</url>
        </repository>
        ...
    </repositories> 

我得到的结果是:

Multiple annotations found at this line:
    - Missing artifact log4j:log4j:jar:1.2.15:compile
    - Missing artifact com.mortennobel:java-image-scaling:jar:0.8.5:compile
    - Missing artifact org.hibernate:hibernate-core:jar:3.3.2.GA:compile
    - Missing artifact com.jhlabs:filters:jar:2.0.235:compile
    - Missing artifact net.java.dev.rome:rome:jar:1.0.0:compile
    - Missing artifact javassist:javassist:jar:3.4.GA:compile
    - Missing artifact jdom:jdom:jar:1.0:compile
    - Missing artifact com.sun.jdmk:jmxtools:jar:1.2.1:compile
    - Missing artifact org.springframework:spring-web:jar:3.1.0.RELEASE:compile
    - Missing artifact org.slf4j:jcl-over-slf4j:jar:1.6.1:runtime
    - Missing artifact org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA:compile
    - Missing artifact commons-io:commons-io:jar:2.0.1:compile
    - Failed to read artifact descriptor for org.hibernate:hibernate-commons-
     annotations:jar:3.3.0.GA
    - Missing artifact org.hibernate:hibernate-entitymanager:jar:3.4.0.GA:compile
    - Missing artifact org.springframework:spring-beans:jar:3.1.0.RELEASE:compile
    - Missing artifact javax.mail:mail:jar:1.4:compile
    - Missing artifact org.slf4j:slf4j-api:jar:1.6.1:compile
    - Missing artifact org.hibernate:hibernate-validator:jar:4.1.0.Final:compile
    - Missing artifact javax.validation:validation-api:jar:1.0.0.GA:compile
    - Missing artifact commons-dbcp:commons-dbcp:jar:1.4:compile
    - Missing artifact org.codehaus.jackson:jackson-mapper-asl:jar:1.8.1:compile
    - Missing artifact org.slf4j:slf4j-log4j12:jar:1.6.1:runtime
    - Missing artifact javax.jms:jms:jar:1.1:compile
    - Missing artifact javax.transaction:jta:jar:1.1:compile
    - Missing artifact joda-time:joda-time:jar:1.6.2:compile
    - Missing artifact javax.servlet.jsp:jsp-api:jar:2.1:provided
    - Missing artifact javax.activation:activation:jar:1.1:compile
    - Missing artifact javax.servlet.jsp.jstl:jstl-api:jar:1.2:compile
    - Missing artifact org.hibernate:hibernate-annotations:jar:3.4.0.GA:compile
    - Missing artifact org.springframework:spring-expression:jar:3.1.0.RELEASE:compile
    - Missing artifact junit:junit:jar:4.8:test
    - Missing artifact org.springframework:spring-core:jar:3.1.0.RELEASE:compile
    - Missing artifact org.springframework:spring-asm:jar:3.1.0.RELEASE:compile
    - Missing artifact javax.servlet:servlet-api:jar:2.5:provided
    - Missing artifact com.sun.jmx:jmxri:jar:1.2.1:compile
    - Missing artifact org.springframework:spring-webmvc:jar:3.1.0.RELEASE:compile
    - Missing artifact org.glassfish.web:jstl-impl:jar:1.2:compile
    - Missing artifact org.codehaus.jackson:jackson-core-asl:jar:1.8.1:compile
    - Missing artifact org.aspectj:aspectjrt:jar:1.6.10:compile
    - Missing artifact javax.annotation:jsr250-api:jar:1.0:compile
    - Missing artifact aopalliance:aopalliance:jar:1.0:compile
    - Missing artifact commons-pool:commons-pool:jar:1.5.4:compile
    - Missing artifact org.springframework:spring-context-support:jar:
     3.1.0.RELEASE:compile
    - Missing artifact commons-collections:commons-collections:jar:3.1:compile
    - Missing artifact commons-fileupload:commons-fileupload:jar:1.2.2:compile
    - Missing artifact mysql:mysql-connector-java:jar:5.1.15:compile
    - Missing artifact org.springframework:spring-aop:jar:3.1.0.RELEASE:compile
    - Missing artifact org.hibernate:ejb3-persistence:jar:1.0.2.GA:compile
    - Missing artifact antlr:antlr:jar:2.7.6:compile
    - Missing artifact org.springframework:spring-context:jar:3.1.0.RELEASE:compile
    - Missing artifact xml-apis:xml-apis:jar:1.0.b2:compile
    - Missing artifact dom4j:dom4j:jar:1.6.1:compile
    - Missing artifact javax.inject:javax.inject:jar:1:compile

我只是无法理解为什么会收到此错误?

有人可以帮我理解吗?

感谢。

1 个答案:

答案 0 :(得分:1)

在顶部关闭</dependencies>标记是错字吗?

也可以this相关吗?