spring-data-jpa 1.6 需要 spring 框架 3 库,这是真的,还是我错过了什么? [英] spring-data-jpa 1.6 requires spring framework 3 libraries, is that true, or what did I miss?
问题描述
来自不同的问题,我看到我的 Spring 库有点混乱.
coming from a different issue, I saw that my Spring libraries are a kind of mixed up.
我有 Spring-4.0.5 库(是的,我想要它们)和 Spring 3.2.9-libraries,这些库显然是通过 maven 作为 spring-data-jpa-1.6 依赖项给出的.Spring-data-jpa 1.4 似乎没有拉取 spring 3 库,但我绝对更愿意使用当前的 1.6.
I have Spring-4.0.5 libraries (yes, I want them), and Spring 3.2.9-libraries, which are obviously given as spring-data-jpa-1.6 dependency through maven. Spring-data-jpa 1.4 seems not to pull the the spring 3 libraries, but I would absolutely prefer to work with the current 1.6.
马文:
<properties>
<org.springframework.version>4.0.5.RELEASE</org.springframework.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.6.0.RELEASE</version>
</dependency>
[...]
有人可以证实这一点,还是我做错了什么?
Can anybody confirm this, or am I simply doing anything completely wrong?
推荐答案
根据 Manuel Jordan 的建议,我不得不手动排除依赖项,因此这里是此依赖项的完整 Maven 代码:
As suggested by Manuel Jordan, I had to manually exclude the dependencies, so here is the full maven code for this dependency:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.6.0.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>spring-aop</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-beans</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-context</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-core</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-expression</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-instrument</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-jdbc</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-orm</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-tx</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
</exclusions>
</dependency>
这篇关于spring-data-jpa 1.6 需要 spring 框架 3 库,这是真的,还是我错过了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!