# base-mybatis-generator-plugin **Repository Path**: mirrors_gspandy/base-mybatis-generator-plugin ## Basic Information - **Project Name**: base-mybatis-generator-plugin - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-16 - **Last Updated**: 2025-10-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Base Mybatis Generator Plugin ====================================== [![github stars](https://img.shields.io/github/stars/liaomengge/base-mybatis-generator-plugin.svg)](https://github.com/liaomengge/base-mybatis-generator-plugin/stargazers) [![github forks](https://img.shields.io/github/forks/liaomengge/base-mybatis-generator-plugin.svg)](https://github.com/liaomengge/base-mybatis-generator-plugin/network) [![maven center](https://img.shields.io/maven-central/v/com.github.liaomengge/base-mybatis-generator-plugin.svg)](https://search.maven.org/search?q=g:com.github.liaomengge%20AND%20a:base-mybatis-generator-plugin) [![github license](https://img.shields.io/github/license/liaomengge/base-mybatis-generator-plugin.svg)](https://github.com/liaomengge/base-mybatis-generator-plugin/blob/master/LICENSE) 1. ##### 概述 mybatis generator plugin主要用于gradle项目生成mybatis文件的插件,不需要额外引入第三方其他配置,支持mysql,pg等,已引入[base-mybatis-plugin](https://github.com/liaomengge/base-mybatis-plugin)中的插件 2. ##### 使用 1. ###### Add Gradle Plugin > ```groovy > apply plugin: 'com.github.liaomengge.MybatisGenerator' > > buildscript { > repositories { > maven { url "https://plugins.gradle.org/m2/" } > maven { url 'https://maven.aliyun.com/repository/public' } > maven { url 'https://maven.aliyun.com/repository/spring' } > maven { url 'https://maven.aliyun.com/repository/spring-plugin' } > maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } > } > dependencies { > classpath "com.github.liaomengge:mybatis-generator-plugin:1.1.0" > } > } > ``` 2. ###### Add Configuration > ```groovy > configurations { > mybatisGenerator > } > > mybatisGenerator { > verbose = false > configFile = 'src/main/resources/generatorConfig.xml' > // optional, here is the override dependencies for the plugin > dependencies { > mybatisGenerator 'org.mybatis.generator:mybatis-generator-core:1.4.0' > mybatisGenerator 'mysql:mysql-connector-java:5.1.47' > mybatisGenerator 'org.postgresql:postgresql:42.2.8' > mybatisGenerator // Here add your mariadb dependencies or else > } > } > ``` 3. ###### Integrate `generatorConfig.xml` > ```xml > > PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" > "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > connectionURL="jdbc:mysql://127.0.0.1:3306/demo?useUnicode=true&zeroDateTimeBehavior=convertToNull&tinyInt1isBit=false" > userId="test" > password="test"> > > > > > > > targetProject="src/test/java/"> > > > > > > > > > targetProject="src/test/java/" type="XMLMAPPER"/> > > sqlProviderName="true" > enableInsert = "false" > enableSelectByExample="false" > enableUpdateByPrimaryKey="false" > enableDeleteByPrimaryKey="false" > enableDeleteByExample="false" > enableCountByExample="false" > enableUpdateByExample="false"> > > typeHandler="org.apache.ibatis.type.LocalDateTimeTypeHandler" > jdbcType="OTHER" javaType="java.time.LocalDateTime"/> > typeHandler="org.apache.ibatis.type.LocalDateTimeTypeHandler" > jdbcType="OTHER" javaType="java.time.LocalDateTime"/> >
> >
> >
> ``` 4. ###### Generator File > `gradle mbg`生产mybatis文件 ##### 附 - 参考文档:https://github.com/kimichen13/mybatis-generator-plugin