简体   繁体   English

Gradle、Spring Boot、spring-boot-starter-data-jpa 升级

[英]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我正在使用 Spring Boot 版本 1.5.7.RELEASE 并想使用以下一些代码来进行一些分页,例如

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.但是,我的org.springframework.data.domain.Sort版本没有by方法。 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.当我更新具有Sort类 ( spring-data-commons ) 的单个 JAR 时,编译错误消失了,但我收到了一堆其他错误。

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 ).希望更“全面”地升级所有 Spring Data 部分,但这似乎没有任何作用(仍然有旧版本的spring-data-commons )。 https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa/2.3.4.RELEASE 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).我假设通过“指向”它也会升级所有依赖项,但我仍然使用 hibernate 5.0 而不是(根据 Maven 存储库链接 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.从 Spring Boot 版本1.5.7.RELEASE升级到版本2.3.4.RELEASE是冒险的。

You should upgrade small piece gradually.你应该逐渐升级小块。 The problem(s) will be easy to diagnostic.问题很容易诊断。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring 引导不添加 spring-boot-starter-data-jpa - Spring boot not adding spring-boot-starter-data-jpa spring-boot-starter-data-jpa依赖错误 - spring-boot-starter-data-jpa dependency error spring-boot-starter-data-jpa:自动重新连接 - spring-boot-starter-data-jpa : Auto Reconnect H2 数据库是用 spring-boot-starter-data-jpa 创建的,但不是用 spring-boot-starter-data-jdbc 创建的 - H2 Database created with spring-boot-starter-data-jpa but not with spring-boot-starter-data-jdbc 在单元测试中带有spring-boot-starter-data-jpa的Spring Boot需要强制使用@DataJpaTest - Spring Boot with spring-boot-starter-data-jpa in unit test needs mandatory @DataJpaTest spring-boot,spring-boot-starter-data-jpa:数据库类型为NONE或找不到更改日志位置 - spring-boot, spring-boot-starter-data-jpa: database type NONE or Cannot find changelog location spring-data-jpa和spring-boot-starter-data-jpa之间的区别 - Difference between spring-data-jpa and spring-boot-starter-data-jpa 未找到依赖项 'org.springframework.boot:spring-boot-starter-data-jpa:2.5.3' - Dependency 'org.springframework.boot:spring-boot-starter-data-jpa:2.5.3' not found 排除 JPA Spring boot - org.springframework.boot:spring-boot-starter-data-jpa' 启动时导致 CRUDRepository 错误 - Exclude JPA Spring boot - org.springframework.boot:spring-boot-starter-data-jpa' causes error in CRUDRepository when starting 将“spring-boot-starter-data-jpa”依赖项添加到Spring项目时出错 - Error when adding “spring-boot-starter-data-jpa” dependency to Spring project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM