build.gradle 1.8 KB

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