build.gradle 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 libraries."flyway-h2"
  47. classpath "gradle.plugin.com.boxfuse.client:gradle-plugin-publishing:6.0.0-beta2"
  48. }
  49. }
  50. apply plugin: "org.flywaydb.flyway"
  51. flyway {
  52. // 写自己本地测试数据库
  53. url = 'jdbc:mysql://127.0.0.1:3306/qianxing'
  54. user = 'qianxing'
  55. password = 'qianxing'
  56. // 线上:mvn package exec:java -Dexec.mainClass=com.qxgmat.Flyway
  57. }
  58. // flyway ------ end
  59. apply plugin: 'java-library'
  60. jar {
  61. // lib目录的清除和复制任务
  62. // dependsOn clearJar
  63. // dependsOn copyJar
  64. enabled=true
  65. }