build.gradle 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. buildscript {
  2. ext {
  3. kotlin_version = '1.3.21'
  4. springBootVersion = '2.1.7.RELEASE'
  5. junit_version = '4.12'
  6. commons_io_version = '2.5'
  7. commons_lang3_version = '3.5'
  8. commons_codec_version = '1.10'
  9. commons_fileupload_version = '1.3.2'
  10. mysql_connector_version = '5.1.45'
  11. mybatisPlusVersion = '3.0.3'
  12. slf4j_api_version = '1.7.25'
  13. rxJavaVersion = '2.2.3'
  14. jwtVersion = '1.4.0'
  15. authVersion = '1.2'
  16. shiro_version = '1.4.0'
  17. swagger_version = '2.7.0'
  18. nacosVersion='2.1.0.RELEASE'
  19. }
  20. repositories {
  21. maven { url 'https://maven.aliyun.com/repository/central' }
  22. maven { url = 'http://repo.spring.io/plugins-release' }
  23. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  24. }
  25. dependencies {
  26. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  27. classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
  28. classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
  29. }
  30. }
  31. allprojects {
  32. group = "cn.gygxzc.cloud.tina"
  33. version = "2.1"
  34. }
  35. subprojects {
  36. apply plugin: 'java'
  37. apply plugin: 'eclipse'
  38. apply plugin: 'org.springframework.boot'
  39. apply plugin: 'io.spring.dependency-management'
  40. apply plugin: 'kotlin'
  41. apply plugin: 'kotlin-kapt'
  42. apply plugin: 'kotlin-spring'
  43. sourceCompatibility = 1.8
  44. targetCompatibility = 1.8
  45. [compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
  46. compileJava.dependsOn(processResources)
  47. ext {
  48. set('springCloudVersion', 'Greenwich.SR2')
  49. set('springBootAdminVersion', '2.1.4')
  50. }
  51. repositories {
  52. maven { url 'https://maven.aliyun.com/repository/public' }
  53. maven { url 'https://maven.aliyun.com/repository/central' }
  54. maven { url 'https://maven.aliyun.com/repository/jcenter' }
  55. }
  56. dependencyManagement {
  57. imports {
  58. mavenBom "de.codecentric:spring-boot-admin-dependencies:${springBootAdminVersion}"
  59. mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
  60. }
  61. }
  62. configurations {
  63. all*.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
  64. }
  65. dependencies {
  66. testCompile('org.springframework.boot:spring-boot-starter-test')
  67. // Kotlin
  68. compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
  69. compile("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
  70. kapt("org.springframework.boot:spring-boot-configuration-processor")
  71. // SpringBoot Starter
  72. compile 'org.springframework.cloud:spring-cloud-starter-bus-amqp'
  73. compile('org.springframework.boot:spring-boot-starter-webflux')
  74. compile('org.springframework.boot:spring-boot-starter-thymeleaf')
  75. compile('org.springframework.cloud:spring-cloud-config-server')
  76. compile('org.springframework.cloud:spring-cloud-config-monitor')
  77. compile('org.springframework.boot:spring-boot-starter-jetty')
  78. compile('org.springframework.boot:spring-boot-starter-jdbc')
  79. compile('org.springframework.boot:spring-boot-starter-cache')
  80. compile("org.springframework.session:spring-session-data-redis")
  81. compile('org.springframework.boot:spring-boot-starter-data-redis')
  82. compile('redis.clients:jedis:2.9.0')
  83. compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-server')
  84. compile('org.springframework.cloud:spring-cloud-starter-openfeign')
  85. //
  86. // commons
  87. compile("commons-io:commons-io:$commons_io_version")
  88. compile("org.apache.commons:commons-lang3:$commons_lang3_version")
  89. compile("commons-codec:commons-codec:$commons_codec_version")
  90. compile("io.reactivex.rxjava2:rxjava:$rxJavaVersion")
  91. // logger
  92. compile("org.slf4j:slf4j-api:$slf4j_api_version")
  93. compile("mysql:mysql-connector-java:$mysql_connector_version")
  94. compile("com.baomidou:mybatis-plus-boot-starter:$mybatisPlusVersion")
  95. // swagger
  96. compile("io.springfox:springfox-swagger2:$swagger_version")
  97. compile("io.springfox:springfox-swagger-ui:$swagger_version")
  98. ext.jarTree = fileTree(dir: 'libs', include: '**/*.jar')
  99. compile jarTree
  100. }
  101. tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
  102. kotlinOptions {
  103. jvmTarget = "1.8"
  104. }
  105. }
  106. bootJar { enabled = false }
  107. jar { enabled = true }
  108. }