1
0

build.gradle 3.8 KB

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