build.gradle 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. apply plugin: 'java'
  2. def libraries = rootProject.ext.libraries
  3. repositories {
  4. mavenLocal()
  5. maven { url = "http://maven.aliyun.com/nexus/content/groups/public" }
  6. mavenCentral()
  7. }
  8. dependencies {
  9. //mybatis
  10. // compileClasspath(libraries."mybatis", libraries."mybatis-mapper", libraries."mybatis-page")
  11. //flyway
  12. compileClasspath libraries."flyway"
  13. parentClasspath libraries."flyway"
  14. }
  15. //mybatis generator plugin ------ start
  16. buildscript {
  17. repositories {
  18. maven {
  19. url "https://plugins.gradle.org/m2/"
  20. }
  21. }
  22. dependencies {
  23. classpath "gradle.plugin.com.arenagod.gradle:mybatis-generator-plugin:1.4"
  24. }
  25. }
  26. apply plugin: "com.arenagod.gradle.MybatisGenerator"
  27. configurations {
  28. mybatisGenerator
  29. }
  30. dependencies{
  31. mybatisGenerator libraries."mybatis-generator"
  32. mybatisGenerator libraries."mybatis-mapper"
  33. mybatisGenerator libraries."mybatis-mapping-generator"
  34. mybatisGenerator libraries."mybatis-generator-plugin"
  35. mybatisGenerator libraries."mybatis-mysql"
  36. mybatisGenerator project(":tools")
  37. }
  38. mybatisGenerator {
  39. // verbose = true
  40. configFile = 'src/main/resources/mybatis-generator.xml'
  41. }
  42. //mybatis generator plugin ------ end
  43. // flyway -------- start
  44. buildscript {
  45. dependencies {
  46. classpath "gradle.plugin.com.boxfuse.client:gradle-plugin-publishing:6.0.0-beta2"
  47. }
  48. }
  49. dependencies {
  50. compileClasspath libraries."flyway-mysql"
  51. }
  52. apply plugin: "org.flywaydb.flyway"
  53. flyway {
  54. // 写自己本地测试数据库
  55. url = 'jdbc:mysql://127.0.0.1:3306/qianxing-test'
  56. user = 'qianxing'
  57. password = 'qianxing'
  58. configurations = [ 'compileClasspath']
  59. // 线上:mvn package exec:java -Dexec.mainClass=com.qxgmat.Flyway
  60. }
  61. // flyway ------ end
  62. apply plugin: 'java-library'
  63. jar {
  64. // lib目录的清除和复制任务
  65. // dependsOn clearJar
  66. // dependsOn copyJar
  67. enabled=true
  68. }