123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- apply plugin: 'java'
- def libraries = rootProject.ext.libraries
- repositories {
- mavenLocal()
- maven { url = "http://maven.aliyun.com/nexus/content/groups/public" }
- mavenCentral()
- }
- dependencies {
- //mybatis
- // compileClasspath(libraries."mybatis", libraries."mybatis-mapper", libraries."mybatis-page")
- //flyway
- compileClasspath libraries."flyway"
- parentClasspath libraries."flyway"
- }
- //mybatis generator plugin ------ start
- buildscript {
- repositories {
- maven {
- url "https://plugins.gradle.org/m2/"
- }
- }
- dependencies {
- classpath "gradle.plugin.com.arenagod.gradle:mybatis-generator-plugin:1.4"
- }
- }
- apply plugin: "com.arenagod.gradle.MybatisGenerator"
- configurations {
- mybatisGenerator
- }
- dependencies{
- mybatisGenerator libraries."mybatis-generator"
- mybatisGenerator libraries."mybatis-mapper"
- mybatisGenerator libraries."mybatis-mapping-generator"
- mybatisGenerator libraries."mybatis-generator-plugin"
- mybatisGenerator libraries."mybatis-mysql"
- mybatisGenerator project(":tools")
- }
- mybatisGenerator {
- // verbose = true
- configFile = 'src/main/resources/mybatis-generator.xml'
- }
- //mybatis generator plugin ------ end
- // flyway -------- start
- buildscript {
- dependencies {
- classpath "gradle.plugin.com.boxfuse.client:gradle-plugin-publishing:6.0.0-beta2"
- }
- }
- dependencies {
- compileClasspath libraries."flyway-mysql"
- }
- apply plugin: "org.flywaydb.flyway"
- flyway {
- // 写自己本地测试数据库
- url = 'jdbc:mysql://127.0.0.1:3306/qianxing-test'
- user = 'qianxing'
- password = 'qianxing'
- configurations = [ 'compileClasspath']
- // 线上:mvn package exec:java -Dexec.mainClass=com.qxgmat.Flyway
- }
- // flyway ------ end
- apply plugin: 'java-library'
- jar {
- // lib目录的清除和复制任务
- // dependsOn clearJar
- // dependsOn copyJar
- enabled=true
- }
|