代码拉取完成,页面将自动刷新
buildscript {
repositories {
mavenLocal()
maven { url "http://maven.aliyun.com/nexus/content/groups/public" }
}
dependencies {
classpath "com.landas:mybatis-generator-plugin:1.0.0"
}
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'com.landas.MybatisGenerator'
sourceCompatibility = 1.8
configurations {
providedRuntime
mybatisGeneratorConf
}
mybatisGeneratorConf {
configFile = 'src/main/resources/mybatis-gen-config.xml'
overwrite = true
contextIds = "mysql"
fullyQualifiedTableNames = "user"
verbose = true
}
在项目路径下直接运行 runGenerator 任务即可:
gradle runGenerator
目前gradle插件向外暴露了如下参数:
参数 | 说明 | 示例 | 默认值 |
---|---|---|---|
configFile | xml配置文件的地址 | src/main/resources/mybatis-gen-config.xml | mybatis-gen-config.xml |
overwrite | 是否覆盖同名文件 | true | true |
verbose | 是否打印日志到控制台 | true | false |
targetDir | 生成文件的根目录 | . | . |
contextIds | 用于过滤configFile文件中的contextId,不填默认为 *。多个ID使用逗号分隔 | mysql,postgres | null |
fullyQualifiedTableNames | 用于过滤configFile文件中的表名。不填默认使用xml配置的table | foo.bar | null |
通用配置请参考 generator-sample 模块中的 mybatis-gen-config.xml
支持使用 commentGenerator.addRemarkComments 开启 field 字段注释
更详细的配置文件参见 mybatis-generator 插件的原生配置
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。