简体   繁体   中英

Maven updating hibernate when upgrade spring to spring 4.1.6 version?

I am working on project and I'm using hibernate with spring framework 3.2.7 version and I'm trying to update spring to the latest version 4.1.6, but the docs of spring shows that this version needs hibernate 4.* version to be compatible with spring.

the question is if I use Maven to update spring, does Maven update hibernate automaticlly to the required version needs in spring?

Hibernate isn't part of the spring framework. You need to modify the hibernate dependency entry from your pom.xml .

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>4.3.8.Final</version>
</dependency>

Spring and Hibernate are different frameworks and there are no dependency between them.You have to modify pom.xml file according to the hibernate version you need, like this

<dependency>
 <groupId>org.hibernate</groupId>
<artifactId>hibernate(the part that you need)</artifactId>
<version>4.*(version that you need)</version>
</dependency> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM