This is only the wrapper for MyBatis Generator on Gradle.
Every details about the generate defined in the file which you declare the path in the mybatisGenerator/configFile
.
You can override the dependencies to the newest version in the configuration, or other database dependencies.
In your build.gradle
file, add following plugin in two ways:
Using the plugins DSL:
plugins {
id "com.thinkimi.gradle.MybatisGenerator" version "2.1.2"
}
Using legacy plugin application:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.thinkimi.gradle:mybatis-generator-plugin:2.1.2"
}
}
apply plugin: "com.thinkimi.gradle.MybatisGenerator"
configurations {
mybatisGenerator
}
mybatisGenerator {
verbose = true
configFile = 'src/main/resources/autogen/generatorConfig.xml'
// optional, here is the override dependencies for the plugin or you can add other database dependencies.
dependencies {
mybatisGenerator 'org.mybatis.generator:mybatis-generator-core:1.3.7'
mybatisGenerator 'mysql:mysql-connector-java:5.1.47'
mybatisGenerator 'org.postgresql:postgresql:42.2.6'
mybatisGenerator // Here add your mariadb dependencies or else
}
}
- Use
docker-compose up -d
to start the db service. - Run gradle
mbGenerator
, then check the related files defined inmybatisGenerator/configFile
.