build.gradle 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. buildscript {
  2. ext {
  3. kotlin_version = '1.2.61'
  4. springBootVersion = '2.0.1.RELEASE'
  5. springCloudVersion = 'Finchley.SR1'
  6. junit_version = '4.12'
  7. commons_io_version = '2.5'
  8. commons_lang3_version = '3.5'
  9. commons_codec_version = '1.10'
  10. commons_fileupload_version = '1.3.2'
  11. slf4j_api_version = '1.7.25'
  12. }
  13. repositories {
  14. mavenCentral()
  15. maven { url = 'http://repo.spring.io/plugins-release' }
  16. }
  17. dependencies {
  18. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  19. classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
  20. classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
  21. }
  22. }
  23. allprojects {
  24. group = "cn.gygxzc.cloud.tina"
  25. version = "1.0"
  26. }
  27. subprojects {
  28. apply plugin: 'java'
  29. apply plugin: 'eclipse'
  30. apply plugin: 'org.springframework.boot'
  31. apply plugin: 'io.spring.dependency-management'
  32. apply plugin: 'kotlin'
  33. apply plugin: 'kotlin-kapt'
  34. apply plugin: 'kotlin-spring'
  35. sourceCompatibility = 1.8
  36. targetCompatibility = 1.8
  37. [compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
  38. compileJava.dependsOn(processResources)
  39. repositories {
  40. mavenCentral()
  41. jcenter()
  42. }
  43. dependencyManagement {
  44. imports {
  45. mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Finchley.SR1'
  46. }
  47. }
  48. configurations{
  49. all*.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
  50. all*.exclude group: 'org.hibernate.validator'
  51. }
  52. dependencies {
  53. // Kotlin
  54. compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
  55. compile("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
  56. kapt("org.springframework.boot:spring-boot-configuration-processor")
  57. // SpringBoot Starter
  58. compile('org.springframework.cloud:spring-cloud-config-server')
  59. compile('org.springframework.boot:spring-boot-starter-jetty')
  60. compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-server')
  61. // compile('org.springframework.cloud:spring-cloud-starter-openfeign')
  62. //
  63. // commons
  64. compile("commons-io:commons-io:$commons_io_version")
  65. compile("org.apache.commons:commons-lang3:$commons_lang3_version")
  66. compile("commons-codec:commons-codec:$commons_codec_version")
  67. // logger
  68. compile("org.slf4j:slf4j-api:$slf4j_api_version")
  69. compile("javax.servlet:javax.servlet-api:3.1.0")
  70. compile("javax.servlet:servlet-api:2.5")
  71. ext.jarTree = fileTree(dir: 'libs', include: '**/*.jar')
  72. compile jarTree
  73. }
  74. tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
  75. kotlinOptions {
  76. jvmTarget = "1.8"
  77. }
  78. }
  79. bootJar { enabled = false }
  80. jar { enabled = true }
  81. }