build.gradle 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. repositories {
  13. mavenLocal()
  14. jcenter()
  15. mavenCentral()
  16. maven {
  17. url 'http://central.maven.org/maven2'
  18. }
  19. }
  20. war {
  21. baseName = 'atalong-spring-boot-gradle'
  22. version = '1.0.0'
  23. }
  24. ext {
  25. mybatis_spring_boot = '1.3.1'
  26. mybatis_typehandlers_jsr310 = '1.0.2'
  27. logback_ext_spring = '0.1.4'
  28. jackson = '2.9.4'
  29. google_guava = '23.3-jre'
  30. okhttp = '3.10.0'
  31. commons_beanutils = '1.9.3'
  32. commons_io = '2.6'
  33. commons_codec = '1.11'
  34. apache_commons_lang3 = '3.6'
  35. apache_httpclient = '4.5.4'
  36. joda_time = '2.9.9'
  37. jedis = '2.9.0'
  38. gson = '2.6.2'
  39. fastjson = '1.2.15'
  40. jsonLib = '2.4'
  41. spring_boot_starter_amqp = '1.5.2.RELEASE'
  42. }
  43. dependencies {
  44. // Spring Boot
  45. testCompile('org.springframework.boot:spring-boot-starter-test')
  46. compile('org.springframework.boot:spring-boot-configuration-processor')
  47. //如果要部署到外部服务器, 需要打war包, 同时使用providedCompile, 内嵌的Tomcat jar包才不会打包到依赖里
  48. //providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
  49. compile('org.springframework.boot:spring-boot-starter-web')
  50. compile('org.springframework.boot:spring-boot-starter-aop')
  51. compile('org.springframework.boot:spring-boot-starter-jdbc')
  52. // Mybatis Spring Boot
  53. compile("org.mybatis.spring.boot:mybatis-spring-boot-starter:${mybatis_spring_boot}")
  54. // Mybatis 支持 Java 1.8 的 LocalDateTime 特性, 需要引入如下包(Mybatis版本要求3.4.0以上)
  55. compile("org.mybatis:mybatis-typehandlers-jsr310:${mybatis_typehandlers_jsr310}")
  56. // Mariadb jdbc
  57. compile('org.mariadb.jdbc:mariadb-java-client')
  58. // HikariCP
  59. compile('com.zaxxer:HikariCP')
  60. // logback对spring的支持
  61. compile("org.logback-extensions:logback-ext-spring:${logback_ext_spring}")
  62. // 数据序列化
  63. compile("com.fasterxml.jackson.core:jackson-databind:${jackson}")
  64. compile("com.fasterxml.jackson.core:jackson-core:${jackson}")
  65. compile("com.fasterxml.jackson.core:jackson-annotations:${jackson}")
  66. // jackson 支持格式化LocalDateTime
  67. compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jackson}")
  68. compile("com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson}")
  69. compile("com.fasterxml.jackson.module:jackson-module-afterburner:${jackson}")
  70. // jackson 支持格式化XML
  71. compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson}")
  72. compile("com.alibaba:fastjson:${fastjson}")
  73. // 工具类
  74. compile("com.google.guava:guava:${google_guava}")
  75. // HTTP工具
  76. compile("com.squareup.okhttp3:okhttp:${okhttp}")
  77. /* apache commons */
  78. compile("commons-beanutils:commons-beanutils:${commons_beanutils}")
  79. compile("commons-io:commons-io:${commons_io}")
  80. compile("commons-codec:commons-codec:${commons_codec}")
  81. compile("org.apache.commons:commons-lang3:${apache_commons_lang3}")
  82. compile("org.apache.httpcomponents:httpclient:${apache_httpclient}")
  83. // joda-time 时间工具
  84. compile("joda-time:joda-time:${joda_time}")
  85. compile("com.google.code.gson:gson:${gson}")
  86. // Jedis
  87. compile("redis.clients:jedis:${jedis}")
  88. // Spring Boot Redis
  89. //compile('org.springframework.boot:spring-boot-starter-entity-redis')
  90. compile("net.sf.json-lib:json-lib:${jsonLib}:jdk15")
  91. compile("org.springframework.boot:spring-boot-starter-amqp:${spring_boot_starter_amqp}")
  92. }