build.gradle 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. plugins {
  2. id 'org.springframework.boot' version '2.0.2.RELEASE'
  3. }
  4. apply plugin: 'java'
  5. apply plugin: 'idea'
  6. apply plugin: 'eclipse'
  7. apply plugin: 'org.springframework.boot'
  8. apply plugin: 'io.spring.dependency-management'
  9. apply plugin: 'war'
  10. group 'com.emato'
  11. sourceCompatibility = 1.8
  12. tasks.withType(JavaCompile) {
  13. options.encoding = "UTF-8"
  14. }
  15. repositories {
  16. mavenCentral()
  17. maven {
  18. url 'http://central.maven.org/maven2'
  19. }
  20. }
  21. war {
  22. baseName = 'cuspay'
  23. version = '1.0.0'
  24. }
  25. ext {
  26. mybatis_spring_boot = '1.3.1'
  27. mybatis_typehandlers_jsr310 = '1.0.2'
  28. logback_ext_spring = '0.1.4'
  29. jackson = '2.9.4'
  30. google_guava = '23.3-jre'
  31. okhttp = '3.10.0'
  32. commons_beanutils = '1.9.3'
  33. commons_io = '2.6'
  34. commons_codec = '1.11'
  35. apache_commons_lang3 = '3.6'
  36. apache_httpclient = '4.5.4'
  37. joda_time = '2.9.9'
  38. jedis = '2.9.0'
  39. gson = '2.8.0'
  40. }
  41. dependencies {
  42. // Spring Boot
  43. testCompile('org.springframework.boot:spring-boot-starter-test')
  44. compile('org.springframework.boot:spring-boot-configuration-processor')
  45. //如果要部署到外部服务器, 需要打war包, 同时使用providedCompile, 内嵌的Tomcat jar包才不会打包到依赖里
  46. //providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
  47. compile('org.springframework.boot:spring-boot-starter-web')
  48. compile('org.springframework.boot:spring-boot-starter-aop')
  49. compile('org.springframework.boot:spring-boot-starter-jdbc')
  50. // Mybatis Spring Boot
  51. compile("org.mybatis.spring.boot:mybatis-spring-boot-starter:${mybatis_spring_boot}")
  52. // Mybatis 支持 Java 1.8 的 LocalDateTime 特性, 需要引入如下包(Mybatis版本要求3.4.0以上)
  53. compile("org.mybatis:mybatis-typehandlers-jsr310:${mybatis_typehandlers_jsr310}")
  54. // Mariadb jdbc
  55. compile('org.mariadb.jdbc:mariadb-java-client')
  56. // HikariCP
  57. compile('com.zaxxer:HikariCP')
  58. // logback对spring的支持
  59. compile("org.logback-extensions:logback-ext-spring:${logback_ext_spring}")
  60. // 数据序列化
  61. compile("com.fasterxml.jackson.core:jackson-databind:${jackson}")
  62. compile("com.fasterxml.jackson.core:jackson-core:${jackson}")
  63. compile("com.fasterxml.jackson.core:jackson-annotations:${jackson}")
  64. // jackson 支持格式化LocalDateTime
  65. compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jackson}")
  66. compile("com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson}")
  67. compile("com.fasterxml.jackson.module:jackson-module-afterburner:${jackson}")
  68. // jackson 支持格式化XML
  69. compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson}")
  70. // 工具类
  71. compile("com.google.guava:guava:${google_guava}")
  72. // HTTP工具
  73. compile("com.squareup.okhttp3:okhttp:${okhttp}")
  74. /* apache commons */
  75. compile("commons-beanutils:commons-beanutils:${commons_beanutils}")
  76. compile("commons-io:commons-io:${commons_io}")
  77. compile("commons-codec:commons-codec:${commons_codec}")
  78. compile("org.apache.commons:commons-lang3:${apache_commons_lang3}")
  79. compile("org.apache.httpcomponents:httpclient:${apache_httpclient}")
  80. // joda-time 时间工具
  81. compile("joda-time:joda-time:${joda_time}")
  82. // Jedis
  83. compile("redis.clients:jedis:${jedis}")
  84. // Spring Boot Redis
  85. compile('org.springframework.boot:spring-boot-starter-data-redis')
  86. //gson
  87. compile("com.google.code.gson:gson:${gson}")
  88. }