build.gradle.kts 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. group = "llh.svs"
  2. version = rootProject.version
  3. val dbUser: String by project
  4. plugins {
  5. id("java")
  6. id("maven-publish")
  7. id("io.spring.dependency-management")
  8. kotlin("jvm")
  9. kotlin("plugin.spring")
  10. kotlin("plugin.jpa")
  11. }
  12. subprojects {
  13. group = "llh.svs.services"
  14. version = rootProject.version
  15. apply(plugin = "java")
  16. apply(plugin = "org.springframework.boot")
  17. apply(plugin = "io.spring.dependency-management")
  18. apply(plugin = "org.jetbrains.kotlin.jvm")
  19. apply(plugin = "org.jetbrains.kotlin.plugin.spring")
  20. apply(plugin = "org.jetbrains.kotlin.plugin.jpa")
  21. dependencies {
  22. api(platform(project(":platform")))
  23. implementation(project(path = ":shared", configuration = "lib"))
  24. implementation(kotlin("reflect"))
  25. implementation(kotlin("stdlib-jdk8"))
  26. implementation("org.springframework.boot:spring-boot-starter-webflux")
  27. implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
  28. implementation("org.springframework.cloud:spring-cloud-starter-openfeign")
  29. implementation("org.springframework.boot:spring-boot-configuration-processor")
  30. implementation("cc-lotus.gaf3:gaf-core-shared")
  31. implementation("cc-lotus.gaf3:gaf-core-services")
  32. implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
  33. implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactive")
  34. implementation("com.alibaba:fastjson")
  35. implementation("net.sourceforge.jexcelapi:jxl")
  36. implementation("javax.validation:validation-api")
  37. runtimeOnly("org.hibernate.validator:hibernate-validator")
  38. testImplementation("org.springframework.boot:spring-boot-starter-test")
  39. testImplementation("junit", "junit", "4.12")
  40. }
  41. dependencyManagement {
  42. imports {
  43. mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}")
  44. }
  45. }
  46. tasks {
  47. processResources {
  48. filesMatching("application.yml") {
  49. expand(project.properties)
  50. }
  51. }
  52. }
  53. tasks.register<Jar>(name = "libJar") {
  54. archiveBaseName.set("svs-${project.name}-lib")
  55. from(sourceSets["main"].output)
  56. include("llh/svs/**", "META-INF/**")
  57. exclude {
  58. it.name.endsWith("Application.class")
  59. }
  60. exclude {
  61. it.name.endsWith("ApplicationKt.class")
  62. }
  63. }
  64. tasks.build { dependsOn(tasks.named("libJar")) }
  65. configurations {
  66. create("lib")
  67. }
  68. artifacts {
  69. add("lib", tasks["libJar"])
  70. }
  71. }
  72. configure(subprojects.filter { it.name != "service-system" }) {
  73. dependencies {
  74. implementation("org.springframework.boot:spring-boot-starter-data-jpa")
  75. runtimeOnly("mysql:mysql-connector-java")
  76. }
  77. }
  78. project("service-system") {
  79. dependencies {
  80. implementation("com.github.oshi:oshi-core:6.1.4")
  81. implementation(project(path = ":services:service-task", configuration = "lib"))
  82. implementation(project(path = ":services:service-schedule", configuration = "lib"))
  83. }
  84. }
  85. tasks.jar {
  86. archiveBaseName.set("svs-core-${project.name}")
  87. configure(subprojects) {
  88. from(tasks.withType<JavaCompile>())
  89. from(tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>())
  90. include("llh/**")
  91. exclude {
  92. it.name.endsWith("Application.class")
  93. }
  94. exclude {
  95. it.name.endsWith("ApplicationKt.class")
  96. }
  97. exclude {
  98. it.name.endsWith("Application${'$'}Companion.class")
  99. }
  100. }
  101. }
  102. publishing {
  103. publications {
  104. create<MavenPublication>("maven") {
  105. artifactId = "svs-core-${project.name}"
  106. from(components["java"])
  107. }
  108. }
  109. }