2012-01-07 74 views
0

我需要使用Hibernate和Spring,我试图找出Maven依赖关系来使用它,它不能太困难,但不知怎的,我无法完成它。休眠的Maven依赖关系

在我开发的玩具应用程序中,我需要实现一些使用案例,这些使用案例一年前我已经开发出来了,或者我使用了Hiebrnate 3.3.2.GA和Hibernate注释3.4.0.GA.所以我只需要与我使用maven时包含在我的项目中的相同的jar。所以我说在我的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

收尾</dependencies>标签顶部是一个错字?

也可能与this有关?

+0

是的,这是一个错字。让我看看它是否会在建立时导致任何问题,因为我看到了lib文件夹中的所有jar。 – skip 2012-01-08 00:17:13