https://github.com/hinsteny/mybatis-generator-plugin
MyBatis Generator With Ant for gradle plugin
https://github.com/hinsteny/mybatis-generator-plugin
gradle-plugin mybaits mybatis-generator mybatis-generator-plugins
Last synced: about 1 month ago
JSON representation
MyBatis Generator With Ant for gradle plugin
- Host: GitHub
- URL: https://github.com/hinsteny/mybatis-generator-plugin
- Owner: Hinsteny
- Created: 2019-02-20T12:48:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-21T01:52:17.000Z (over 6 years ago)
- Last Synced: 2025-03-26T16:46:34.162Z (7 months ago)
- Topics: gradle-plugin, mybaits, mybatis-generator, mybatis-generator-plugins
- Language: Groovy
- Size: 76.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Mybatis Generator Gradle Plugin
======================================[](https://travis-ci.org/Hinsteny/mybatis-generator-plugin)
[](https://codecov.io/gh/Hinsteny/mybatis-generator-plugin)## Introduction
Because of the MyBatis-Generator
## Quick Start
### 1. Add MyBatis-Generator gradle plugin
In your ```build.gradle``` file, add following plugin:
``` groovy
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.org.hisoka.gradle:mybatis-generator-plugin:0.0.1"
}
}plugins {
id 'java'
id 'eclipse'
id "org.hisoka.gradle.mybatis-generator-plugin" version "0.0.1"}
/*apply plugin: "org.hisoka.gradle.mybatis-generator-plugin"*/
dependencies {
mybatisGenerator('org.mybatis.generator:mybatis-generator-core:1.3.7')
mybatisGenerator('mysql:mysql-connector-java:8.0.15')
}configurations {
mybatisGenerator
}mybatisGenerator {
verbose = true
configFile = 'src/main/resources/autogen/generatorConfig.xml'
configPropertiesFile = 'src/main/resources/autogen/mybatis.properties'
}
```### 2. Create MyBatis-Generator config file
src/main/resources/autogen/generatorConfig.xml, example at below
```
```
src/main/resources/autogen/mybatis.properties, example at below
```
db.driver.class=com.mysql.jdbc.Driver
db.url=jdbc:mysql://127.0.0.1:3306/pay?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true
db.username=pay_user
db.password=welcome
model.package=org.kirin.mybatis.pojo
mapper.package=org.kirin.mybatis.mapper
xml.package=mapper
```### 3. Execute plugin action
```batch
gradle mybatisGenerate
```## Deep development
Any body can do one forward develop at this project!
### 1. Add yourself mybatis-generator plugins
- extend your function in `MybatisGeneratorPlugin`
- Build plugin
```
gradle build
```- Publish plugin to local maven_gradle_plugin repositories
```
gradle publishPluginMavenPublicationToLocalMavenGradlePluginRepository
```- Publish plugin to local maven repositories
```
gradle publishPluginMavenPublicationToMavenLocal
```- Publish plugin to gradle plugins center to the account of yourself
```
gradle publishPlugins
```## Trouble Shooting and Logs
Please commit messages to github-project-issues dashboard if you found any bugs or have any ideas!
## License
[MIT](http://opensource.org/licenses/MIT)Copyright (c) 2019-present, Hinsteny