具体代码地址:https://github.com/Kevin-Karl-Wang/ssmDemo
在build.gradle内添加
buildscript {
repositories {
maven {
url “https://plugins.gradle.org/m2/”
}
}
dependencies {
classpath “gradle.plugin.com.arenagod.gradle:mybatis-generator-plugin:1.3”
}
}
apply plugin: “com.arenagod.gradle.MybatisGenerator”
configurations {
mybatisGenerator
}
mybatisGenerator {
verbose = true
configFile = ‘src/main/resources/config/generatorConfig.xml’
}
jar包要引入
compile group: ‘org.mybatis.generator’, name: ‘mybatis-generator-core’, version: ‘1.3.3’
compile group: ‘org.mybatis.generator’, name: ‘mybatis-generator-maven-plugin’, version: ‘1.3.2’
然后配置generatorConfig.xml