2012-03-08 5 views
3

스프링 데이터 JPA를 어떻게 사용하고 Spring 3.1.0/3.1.1을 사용할 수 있을지 아는 사람이 있습니까?스프링 데이터 JPA와 스프링 3.1.0 사용하기

스프링 데이터 JPA 1.0.3은 스프링 3.0.5에 의존하므로 스프링 데이터 jpa를 종속성으로 추가하자 마자 3.1.0을 사용하면서 충돌이 발생합니다.

나는 maven 제외를 사용해 보았지만 많은 성공을 거두지 못했습니다.

답변

6

스프링 데이터 JPA 1.0.3과 스프링 3.1.0을 성공적으로 통합했습니다. 여기에 잘 보이는 pom.xml 박탈된다

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.example</groupId> 
    <artifactId>example</artifactId> 
    <version>1.0.0-SNAPSHOT</version> 

    <dependencies> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-core</artifactId> 
      <version>3.1.0.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-aspects</artifactId> 
      <version>3.1.0.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-orm</artifactId> 
      <version>3.1.0.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-test</artifactId> 
      <version>3.1.0.RELEASE</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.data</groupId> 
      <artifactId>spring-data-jpa</artifactId> 
      <version>1.0.3.RELEASE</version> 
     </dependency> 
    </dependencies> 

</project> 

는 이적 종속성을 보면, 모든 확인을 보인다

$ mvn dependency:tree 
    com.example:example:jar:1.0.0-SNAPSHOT 
+- org.springframework:spring-core:jar:3.1.0.RELEASE:compile 
| +- org.springframework:spring-asm:jar:3.1.0.RELEASE:compile 
| \- commons-logging:commons-logging:jar:1.1.1:compile 
+- org.springframework:spring-aspects:jar:3.1.0.RELEASE:compile 
| +- org.springframework:spring-beans:jar:3.1.0.RELEASE:compile 
| +- org.springframework:spring-context:jar:3.1.0.RELEASE:compile 
| | +- org.springframework:spring-aop:jar:3.1.0.RELEASE:compile 
| | \- org.springframework:spring-expression:jar:3.1.0.RELEASE:compile 
| \- org.springframework:spring-context-support:jar:3.1.0.RELEASE:compile 
+- org.springframework:spring-orm:jar:3.1.0.RELEASE:compile 
| +- org.springframework:spring-jdbc:jar:3.1.0.RELEASE:compile 
| \- org.springframework:spring-tx:jar:3.1.0.RELEASE:compile 
|  \- aopalliance:aopalliance:jar:1.0:compile 
+- org.springframework:spring-test:jar:3.1.0.RELEASE:test (scope not updated to compile) 
\- org.springframework.data:spring-data-jpa:jar:1.0.3.RELEASE:compile 
    +- org.springframework.data:spring-data-commons-core:jar:1.1.0.RELEASE:compile 
    +- org.slf4j:slf4j-api:jar:1.6.1:compile 
    +- org.slf4j:jcl-over-slf4j:jar:1.6.1:runtime 
    \- org.aspectj:aspectjrt:jar:1.6.8:compile 

당신은 충돌의 어떤 종류가 있습니까?

+0

감사합니다. 나무 생성에 -Dverbose를 추가하십시오 ... –

+1

예, 많은 정보를 얻으실 수 있습니다 : org.springframework : spring-beans : jar : 3.0.5.RELEASE : 3.1.0과의 충돌을 위해 컴파일되지 않았습니다. . 릴리스 (RELEASE) - 괜찮습니다. 새롭거나 명시 적으로 선언 된 의존성을 선택합니다. 기능, 버그가 아닙니다 :-). 최종 아티팩트는 최신 버전을 사용합니다. –

관련 문제