The version of spring-data-r2dbc
that you are using isn't compatible with the versions of the other Spring Data modules that Spring Boot 2.3.x uses by default.
Spring Boot 2.3 has dependency management and a starter module for Spring Data R2DBC so you can align the versions by using the starter and removing the versions from your pom.
Replace the following three dependencies:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-r2dbc</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>io.r2dbc</groupId>
<artifactId>r2dbc-spi</artifactId>
<version>0.8.0.RELEASE</version>
</dependency>
<dependency>
<groupId>io.r2dbc</groupId>
<artifactId>r2dbc-postgresql</artifactId>
<version>0.8.0.RELEASE</version>
</dependency>
With the following:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-r2dbc</artifactId>
</dependency>
<dependency>
<groupId>io.r2dbc</groupId>
<artifactId>r2dbc-postgresql</artifactId>
<scope>runtime</scope>
</dependency>
The spring-data-r2dbc
and r2dbc-spi
dependencies are both part of the spring-boot-starter-data-r2dbc
dependency that replaces them. The versions are provided by the dependency management in spring-boot-starter-parent
.
If you have a similar problem in the future using the Explore feature of https://start.spring.io can be useful for figuring out how your pom should look.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…