使用spring data jpa的问题,依赖包版本
问题描述:
我项目用的是spring3.2
但是spring data jpa用到spring-aop3.1的包
怎么解决版本问题呢?
我用的maven构建项目
答
那就使用maven的exclusions标签,取消使用自动依赖的版本。如jersey对于spring的依赖,使用exclusions标签就可以了
[code="java"]
com.sun.jersey.contribs
jersey-spring
1.10
<!-- 去除自动依赖的spring版本 -->
org.springframework
spring-aop
[/code]
答
那你用maven直接使用spring-aop3.2版本的就行了吧
[code="java"]
org.springframework
spring-aop
3.2.2.RELEASE
[/code]
答
你只要引入了 自动会找相关的依赖
<!-- spring jpa -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>${spring.data.jpa.version}</version>
</dependency>
1.2.0.RELEASE 默认引入3.1.2.RELEASE
可以参考我的这个 去把spring那块拷贝过去
[url]https://github.com/zhangkaitao/es/blob/master/parent/pom.xml[/url]