Skip to content

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>

Spring Boot3

<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<version>3.5.12</version>
</dependency>

Spring

<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>3.5.12</version>
</dependency>

Solon

<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-solon-plugin</artifactId>
<version>3.5.12</version>
</dependency>

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. Since jsqlparser 5.0+ no longer supports jdk8, this issue is resolved by decoupling the jsqlparser dependency. The correct approach is to introduce the mybatis-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 management
dependencyManagement {
imports {
mavenBom "com.baomidou:mybatis-plus-bom:3.5.9+ version"
}
}
// spring boot3 optional module
implementation("com.baomidou:mybatis-plus-spring-boot3-starter")
// jdk 11+ optional module
implementation("com.baomidou:mybatis-plus-jsqlparser")
// spring boot2 optional module
implementation("com.baomidou:mybatis-plus-boot-starter")
// jdk 8+ optional module
implementation("com.baomidou:mybatis-plus-jsqlparser-4.9")
Baomidou

© 2016-2025 Baomidou™. All Rights Reserved.

Power by Astro Starlight | Sponsored by JetBrains

渝ICP备2021000141号-1 | 渝公网安备50011302222097