build.gradle 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. // Gradle plugin
  2. plugins {
  3. id 'org.springframework.boot' version '2.2.5.RELEASE'
  4. id 'io.spring.dependency-management' version '1.0.9.RELEASE'
  5. }
  6. apply plugin: 'java'
  7. apply plugin: 'war'
  8. apply plugin: "org.springframework.boot"
  9. //提供类似Maven dependencyManagement依赖管理功能
  10. apply plugin: 'io.spring.dependency-management'
  11. group = 'com.emato'
  12. version = '1.0.0'
  13. sourceCompatibility = 1.8
  14. war {
  15. archiveBaseName = 'cus-wms-supervise2.0'
  16. }
  17. // 解决中文乱码
  18. tasks.withType(JavaCompile) {
  19. options.encoding = "UTF-8"
  20. }
  21. repositories {
  22. // 本地仓库
  23. mavenLocal()
  24. // ali 代理的central仓
  25. maven {url 'https://maven.aliyun.com/repository/central'}
  26. // ali 代理的central仓和jcenter仓的聚合仓
  27. maven {url 'https://maven.aliyun.com/repository/public'}
  28. maven {url 'https://maven.aliyun.com/repository/google'}
  29. maven {url 'https://maven.aliyun.com/repository/gradle-plugin'}
  30. maven {url 'https://maven.aliyun.com/repository/spring'}
  31. maven {url 'https://maven.aliyun.com/repository/spring-plugin'}
  32. maven {url 'https://maven.aliyun.com/repository/grails-core'}
  33. // 远程中央仓库
  34. mavenCentral()
  35. maven {url 'https://repo1.maven.org/maven2/'}
  36. maven {url 'https://plugins.gradle.org/m2/'}
  37. maven {url 'https://repo.spring.io/libs-milestone/'}
  38. maven {url 'https://repo.spring.io/plugins-release/'}
  39. maven {url 'https://repo.grails.org/grails/core/'}
  40. maven {url 'https://repository.apache.org/content/groups/public/'}
  41. maven {url 'https://repository.jboss.org/nexus/content/repositories/releases/'}
  42. // 配置使用其它nexus 私服
  43. maven {
  44. // 非https需要增加对不安全协议的信任
  45. allowInsecureProtocol true
  46. url 'http://nexus.ds-bay.com/content/groups/public/'
  47. credentials {
  48. username 'admin'
  49. password 'admin123'
  50. }
  51. }
  52. //maven {url 'others url'}
  53. }
  54. ext {
  55. mybatis_spring_boot = '1.3.1'
  56. mybatis_typehandlers_jsr310 = '1.0.2'
  57. logback_ext_spring = '0.1.4'
  58. jackson = '2.9.8'
  59. google_guava = '23.3-jre'
  60. cage = '1.0'
  61. okhttp = '3.4.1'
  62. apache_commons_lang3 = '3.6'
  63. gson = '2.8.0'
  64. snakeyaml = '1.25'
  65. }
  66. dependencies {
  67. // Spring Boot
  68. testImplementation('org.springframework.boot:spring-boot-starter-test')
  69. implementation('org.springframework.boot:spring-boot-starter-tomcat')
  70. implementation('org.springframework.boot:spring-boot-starter-web')
  71. implementation('org.springframework.boot:spring-boot-starter-aop')
  72. implementation('org.springframework.boot:spring-boot-starter-jdbc')
  73. // Mybatis Spring Boot
  74. implementation("org.mybatis.spring.boot:mybatis-spring-boot-starter:${mybatis_spring_boot}")
  75. // Mybatis支持使用LocalDateTime
  76. implementation("org.mybatis:mybatis-typehandlers-jsr310:${mybatis_typehandlers_jsr310}")
  77. // Spring Boot自带的2.x 版本的 mariadb 包,包里的AbstractConnectProtocol.java 里有session_track_schema参数,
  78. // 在连接mysql 5.6 版本数据库时,会报Unknown system variable 'session_track_schema'异常,需要使用低版本 mariadb 1.5.9
  79. // 连接mysql 5.7+ 无此问题
  80. // Mariadb jdbc
  81. //implementation('org.mariadb.jdbc:mariadb-java-client')
  82. // 生产库使用mysql 5.6版本, 需要使用低版本mariadb
  83. implementation("org.mariadb.jdbc:mariadb-java-client:1.5.9")
  84. // HikariCP
  85. implementation('com.zaxxer:HikariCP')
  86. // logback对spring的支持
  87. implementation("org.logback-extensions:logback-ext-spring:${logback_ext_spring}")
  88. // 数据序列化
  89. implementation("com.fasterxml.jackson.core:jackson-databind:${jackson}")
  90. implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jackson}")
  91. implementation("com.fasterxml.jackson.module:jackson-module-afterburner:${jackson}")
  92. // 工具类
  93. implementation("com.google.guava:guava:${google_guava}")
  94. implementation("org.apache.commons:commons-lang3:${apache_commons_lang3}")
  95. //gson
  96. implementation("com.google.code.gson:gson:${gson}")
  97. // 读取yml文件
  98. implementation("org.yaml:snakeyaml:${snakeyaml}")
  99. }