Install MariaDB Connector/R2DBC
This page is part of MariaDB's Documentation.
The parent of this page is: Using Spring Data with MariaDB Connector/R2DBC
Topics on this page:
Overview
Spring Data R2DBC and MariaDB Connector/R2DBC are usually installed using Maven.
It should also be possible to install Spring Data R2DBC and MariaDB Connector/R2DBC by downloading the JAR files. Because Spring Data R2DBC has many dependencies we recommend using Maven, so that dependencies can be resolved by Maven.
Install MariaDB Connector/R2DBC via Maven
To install Spring module for R2DBC, add the
spring-boot-starter-data-r2dbc
package dependency to your application'spom.xml
file:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-r2dbc</artifactId> <version>3.3.5</version> </dependency>
Since spring boot 3.0, the MariaDB connector is defined as a possible dependency. So setting dependency just needs:
<dependency> <groupId>org.mariadb</groupId> <artifactId>r2dbc-mariadb</artifactId> </dependency>
For spring boot before 3.0, a connector compatible with the R2DBC 0.9.1 spec needs to be set in place of
org.mariadb:r2dbc-mariadb
(be careful not to have anyorg.mariadb:r2dbc-mariadb
dependency set):<dependency> <groupId>org.mariadb</groupId> <artifactId>r2dbc-mariadb-0.9.1-spec</artifactId> <version>1.2.2</version> </dependency>
To build your application, run Maven:
$ mvn package
During the build process, Maven downloads and installs MariaDB Connector/R2DBC and other dependencies from the relevant repositories.