Installation
The brand-new MyBatis-Plus
3.0 version is based on JDK8 and provides lambda
-style calls, so the requirements for installing and integrating MP3.0 are as follows:
- JDK 8+
- Maven or Gradle
Release
Spring Boot2
<dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.5.12</version></dependency>
implementation 'com.baomidou:mybatis-plus-boot-starter:3.5.12'
Spring Boot3
<dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-spring-boot3-starter</artifactId> <version>3.5.12</version></dependency>
implementation 'com.baomidou:mybatis-plus-spring-boot3-starter:3.5.12'
Spring
<dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus</artifactId> <version>3.5.12</version></dependency>
implementation 'com.baomidou:mybatis-plus:3.5.12'
Solon
<dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-solon-plugin</artifactId> <version>3.5.12</version></dependency>
implementation 'com.baomidou:mybatis-plus-solon-plugin:3.5.12'
Snapshot
Snapshot SNAPSHOT versions require adding a repository, and the version number is a snapshot version. Click to view the latest snapshot version.
Maven:
<repository> <id>snapshots</id> <url>https://central.sonatype.com/repository/maven-snapshots/</url></repository>
If you cannot download snapshots when using a proxy repository, add !snapshots
to mirrorOf.
<mirror> <id>aliyunmaven</id> <mirrorOf>*,!snapshots</mirrorOf> <name>Alibaba Cloud Public Repository</name> <url>https://maven.aliyun.com/repository/public</url></mirror>
Gradle:
repositories { maven { url 'https://central.sonatype.com/repository/maven-snapshots/' }}
Maven bom
Use
maven bom
to manage dependencies and reduce version conflicts. Sincejsqlparser 5.0+
no longer supportsjdk8
, this issue is resolved by decoupling thejsqlparser
dependency. The correct approach is to introduce themybatis-plus-bom
module, then add..starter
and..jsqlparser..
dependencies.mybatis-plus-jsqlparser: This dependency will follow the latest version of jsqlparser.
mybatis-plus-jsqlparser-xx: Specific versions of jsqlparser that are incompatible with updates.
- Maven
<dependencyManagement> <dependencies> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-bom</artifactId> <version>3.5.9+ version</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies></dependencyManagement>
<!-- spring boot3 optional module --><dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-spring-boot3-starter</artifactId></dependency>
<!-- jdk 11+ optional module --><dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-jsqlparser</artifactId></dependency>
<!-- spring boot2 optional module --><dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId></dependency>
<!-- jdk 8+ optional module --><dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-jsqlparser-4.9</artifactId></dependency>
- Gradle
// Dependency managementdependencyManagement { imports { mavenBom "com.baomidou:mybatis-plus-bom:3.5.9+ version" }}
// spring boot3 optional moduleimplementation("com.baomidou:mybatis-plus-spring-boot3-starter")
// jdk 11+ optional moduleimplementation("com.baomidou:mybatis-plus-jsqlparser")
// spring boot2 optional moduleimplementation("com.baomidou:mybatis-plus-boot-starter")
// jdk 8+ optional moduleimplementation("com.baomidou:mybatis-plus-jsqlparser-4.9")