build.gradle 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. buildscript {
  2. ext {
  3. kotlin_version = '1.3.21'
  4. springBootVersion = '2.1.7.RELEASE'
  5. mybatisPlusVersion = '3.0.3'
  6. junit_version = '4.12'
  7. commons_io_version = '2.5'
  8. commons_lang3_version = '3.5'
  9. commons_codec_version = '1.10'
  10. slf4j_api_version = '1.7.25'
  11. mysql_connector_version = '5.1.45'
  12. mybatis_plus_version = '2.2.0'
  13. mybatis_plus_boot_version = '1.0.5'
  14. swagger_version = '2.7.0'
  15. caffeine_version = '2.6.1'
  16. shiro_version = '1.4.0'
  17. pinyin4j_version = '2.5.1'
  18. rxJavaVersion='2.2.3'
  19. jwtVersion = '1.4.1'
  20. authVersion='1.2.3'
  21. }
  22. repositories {
  23. maven { url 'https://maven.aliyun.com/repository/central' }
  24. maven { url = 'http://repo.spring.io/plugins-release' }
  25. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  26. }
  27. dependencies {
  28. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  29. classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
  30. classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
  31. }
  32. }
  33. allprojects {
  34. group = "cn.tonyandmoney.tuon"
  35. version = "1.1"
  36. }
  37. subprojects {
  38. apply plugin: 'java'
  39. apply plugin: 'eclipse'
  40. apply plugin: 'org.springframework.boot'
  41. apply plugin: 'io.spring.dependency-management'
  42. apply plugin: 'kotlin'
  43. apply plugin: 'kotlin-kapt'
  44. apply plugin: 'kotlin-spring'
  45. sourceCompatibility = 1.8
  46. targetCompatibility = 1.8
  47. [compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
  48. compileJava.dependsOn(processResources)
  49. ext{
  50. set('springCloudVersion', 'Greenwich.SR2')
  51. set('springBootAdminVersion', '2.1.4')
  52. }
  53. repositories {
  54. maven { url 'https://maven.aliyun.com/repository/public' }
  55. maven { url 'https://maven.aliyun.com/repository/central' }
  56. maven { url 'https://maven.aliyun.com/repository/jcenter' }
  57. }
  58. dependencyManagement {
  59. imports {
  60. mavenBom "de.codecentric:spring-boot-admin-dependencies:${springBootAdminVersion}"
  61. mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
  62. mavenBom 'org.springframework.session:spring-session-bom:Bean-SR2'
  63. }
  64. }
  65. configurations{
  66. all*.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
  67. }
  68. dependencies {
  69. annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
  70. kapt("org.springframework.boot:spring-boot-configuration-processor")
  71. // Kotlin
  72. compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
  73. compile("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
  74. testCompile('org.springframework.boot:spring-boot-starter-test')
  75. // mq
  76. compile("io.reactivex.rxjava2:rxjava:$rxJavaVersion")
  77. compile("com.belerweb:pinyin4j:$pinyin4j_version")
  78. // commons
  79. compile("commons-io:commons-io:$commons_io_version")
  80. compile("org.apache.commons:commons-lang3:$commons_lang3_version")
  81. compile("commons-codec:commons-codec:$commons_codec_version")
  82. compile("javax.servlet:javax.servlet-api:4.0.1")
  83. // swagger
  84. compile("io.springfox:springfox-swagger2:$swagger_version")
  85. compile("io.springfox:springfox-swagger-ui:$swagger_version")
  86. ext.jarTree = fileTree(dir: 'libs', include: '**/*.jar')
  87. compile jarTree
  88. }
  89. tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
  90. kotlinOptions {
  91. jvmTarget = "1.8"
  92. }
  93. }
  94. bootJar { enabled = false }
  95. jar { enabled = true }
  96. }