简体   繁体   中英

Gradle, Spring Boot, spring-boot-starter-data-jpa upgrade

I am using Spring Boot version 1.5.7.RELEASE and wanted to use some of the following code for some pagination stuff something like

Pageable pageable = PageRequest.of(0, 1, org.springframework.data.domain.Sort.by(Sort.Direction.ASC, "seatNumber"));

However, my version of org.springframework.data.domain.Sort doesn't have the by method. When I update the individual JAR that has the Sort class ( spring-data-commons ) the compilation error goes away but I get a bunch of other errors.

So I tried doing something like this

compile 'org.springframework.boot:spring-boot-starter-data-jpa:2.3.4.RELEASE'

To hopefully more "holistically" upgrade all the Spring Data pieces, but that doesn't seem to do anything (still have the old version of spring-data-commons ). https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa/2.3.4.RELEASE

I assumed by "pointing" to it would upgrade all the dependencies too but I am still on hibernate 5.0 instead of (according to the Maven repository link hibernate 5.4). Anyways in summary I would like to upgrade just the spring data pieces if that is possible, with a simple one liner, or at least understand why doing what I mentioned doesn't work.

Upgrading from Spring Boot version 1.5.7.RELEASE to version 2.3.4.RELEASE is to adventurous.

You should upgrade small piece gradually. The problem(s) will be easy to diagnostic.

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