Skip to content

Install

The brand new MyBatis-Plus 3.0 version is based on JDK 8 and provides lambda-style calls, so the installation and integration requirements for MP 3.0 are as follows:

  • JDK 8+
  • Maven or Gradle

Release

Spring Boot 2

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

Spring Boot 3

<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

The SNAPSHOT version requires adding a repository, and the version number is the snapshot version Click to view the latest snapshot version number.

Maven:

<repository>
<id>snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
</repository>

When the snapshot cannot be downloaded through a proxy repository, please add !snapshots to mirrorOf.

<mirror>
<id>aliyunmaven</id>
<mirrorOf>*,!snapshots</mirrorOf>
<name>阿里云公共仓库</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. Because jsqlparser 5.0+ versions no longer support jdk8, the jsqlparser dependency is decoupled to address this issue. The correct way is to introduce the mybatis-plus-bom module, and then introduce the ..starter and ..jsqlparser.. dependencies.

mybatis-plus-jsqlparser: This dependency will be updated with the latest supported version of jsqlparser.

mybatis-plus-jsqlparser-xx: This is for specific supported versions of jsqlparser, meaning versions that are not compatible 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>
<!-- Optional module for Spring Boot 3 -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
</dependency>
<!-- Optional module for JDK 11+ -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-jsqlparser</artifactId>
</dependency>
<!-- Optional module for Spring Boot 2 -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<!-- Optional module for JDK 8+ -->
<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"
}
}
// Optional module for Spring Boot 3
implementation("com.baomidou:mybatis-plus-spring-boot3-starter")
// Optional module for JDK 11+
implementation("com.baomidou:mybatis-plus-jsqlparser")
// Optional module for Spring Boot 2
implementation("com.baomidou:mybatis-plus-boot-starter")
// Optional module for JDK 8+
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