plugins { id 'org.springframework.boot' version '2.0.2.RELEASE' } apply plugin: 'java' apply plugin: 'idea' apply plugin: 'eclipse' //apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' apply plugin: 'war' group 'com.emato' sourceCompatibility = 1.8 repositories { mavenLocal() jcenter() mavenCentral() maven { url 'http://central.maven.org/maven2' } } war { baseName = 'atalong-spring-boot-gradle' version = '1.0.0' } ext { mybatis_spring_boot = '1.3.1' mybatis_typehandlers_jsr310 = '1.0.2' logback_ext_spring = '0.1.4' jackson = '2.9.4' google_guava = '23.3-jre' okhttp = '3.10.0' commons_beanutils = '1.9.3' commons_io = '2.6' commons_codec = '1.11' apache_commons_lang3 = '3.6' apache_httpclient = '4.5.4' joda_time = '2.9.9' jedis = '2.9.0' gson = '2.6.2' fastjson = '1.2.15' jsonLib = '2.4' spring_boot_starter_amqp = '1.5.2.RELEASE' } dependencies { // Spring Boot testCompile('org.springframework.boot:spring-boot-starter-test') compile('org.springframework.boot:spring-boot-configuration-processor') //如果要部署到外部服务器, 需要打war包, 同时使用providedCompile, 内嵌的Tomcat jar包才不会打包到依赖里 //providedRuntime('org.springframework.boot:spring-boot-starter-tomcat') compile('org.springframework.boot:spring-boot-starter-web') compile('org.springframework.boot:spring-boot-starter-aop') compile('org.springframework.boot:spring-boot-starter-jdbc') // Mybatis Spring Boot compile("org.mybatis.spring.boot:mybatis-spring-boot-starter:${mybatis_spring_boot}") // Mybatis 支持 Java 1.8 的 LocalDateTime 特性, 需要引入如下包(Mybatis版本要求3.4.0以上) compile("org.mybatis:mybatis-typehandlers-jsr310:${mybatis_typehandlers_jsr310}") // Mariadb jdbc compile('org.mariadb.jdbc:mariadb-java-client') // HikariCP compile('com.zaxxer:HikariCP') // logback对spring的支持 compile("org.logback-extensions:logback-ext-spring:${logback_ext_spring}") // 数据序列化 compile("com.fasterxml.jackson.core:jackson-databind:${jackson}") compile("com.fasterxml.jackson.core:jackson-core:${jackson}") compile("com.fasterxml.jackson.core:jackson-annotations:${jackson}") // jackson 支持格式化LocalDateTime compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jackson}") compile("com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson}") compile("com.fasterxml.jackson.module:jackson-module-afterburner:${jackson}") // jackson 支持格式化XML compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson}") compile("com.alibaba:fastjson:${fastjson}") // 工具类 compile("com.google.guava:guava:${google_guava}") // HTTP工具 compile("com.squareup.okhttp3:okhttp:${okhttp}") /* apache commons */ compile("commons-beanutils:commons-beanutils:${commons_beanutils}") compile("commons-io:commons-io:${commons_io}") compile("commons-codec:commons-codec:${commons_codec}") compile("org.apache.commons:commons-lang3:${apache_commons_lang3}") compile("org.apache.httpcomponents:httpclient:${apache_httpclient}") // joda-time 时间工具 compile("joda-time:joda-time:${joda_time}") compile("com.google.code.gson:gson:${gson}") // Jedis compile("redis.clients:jedis:${jedis}") // Spring Boot Redis //compile('org.springframework.boot:spring-boot-starter-entity-redis') compile("net.sf.json-lib:json-lib:${jsonLib}:jdk15") compile("org.springframework.boot:spring-boot-starter-amqp:${spring_boot_starter_amqp}") }