group = "llh.svs" version = rootProject.version val dbUser: String by project plugins { id("java") id("maven-publish") id("io.spring.dependency-management") kotlin("jvm") kotlin("plugin.spring") kotlin("plugin.jpa") } subprojects { group = "llh.svs.services" version = rootProject.version apply(plugin = "java") apply(plugin = "org.springframework.boot") apply(plugin = "io.spring.dependency-management") apply(plugin = "org.jetbrains.kotlin.jvm") apply(plugin = "org.jetbrains.kotlin.plugin.spring") apply(plugin = "org.jetbrains.kotlin.plugin.jpa") dependencies { api(platform(project(":platform"))) implementation(project(path = ":shared", configuration = "lib")) implementation(kotlin("reflect")) implementation(kotlin("stdlib-jdk8")) implementation("org.springframework.boot:spring-boot-starter-webflux") implementation("com.fasterxml.jackson.module:jackson-module-kotlin") implementation("org.springframework.cloud:spring-cloud-starter-openfeign") implementation("org.springframework.boot:spring-boot-configuration-processor") implementation("cc-lotus.gaf3:gaf-core-shared") implementation("cc-lotus.gaf3:gaf-core-services") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactive") implementation("com.alibaba:fastjson") implementation("net.sourceforge.jexcelapi:jxl") implementation("javax.validation:validation-api") runtimeOnly("org.hibernate.validator:hibernate-validator") testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("junit", "junit", "4.12") } dependencyManagement { imports { mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}") } } tasks { processResources { filesMatching("application.yml") { expand(project.properties) } } } tasks.register(name = "libJar") { archiveBaseName.set("svs-${project.name}-lib") from(sourceSets["main"].output) include("llh/svs/**", "META-INF/**") exclude { it.name.endsWith("Application.class") } exclude { it.name.endsWith("ApplicationKt.class") } } tasks.build { dependsOn(tasks.named("libJar")) } configurations { create("lib") } artifacts { add("lib", tasks["libJar"]) } } configure(subprojects.filter { it.name != "service-system" }) { dependencies { implementation("org.springframework.boot:spring-boot-starter-data-jpa") runtimeOnly("mysql:mysql-connector-java") } } project("service-system") { dependencies { implementation("com.github.oshi:oshi-core:6.1.4") implementation(project(path = ":services:service-task", configuration = "lib")) implementation(project(path = ":services:service-schedule", configuration = "lib")) } } tasks.jar { archiveBaseName.set("svs-core-${project.name}") configure(subprojects) { from(tasks.withType()) from(tasks.withType()) include("llh/**") exclude { it.name.endsWith("Application.class") } exclude { it.name.endsWith("ApplicationKt.class") } exclude { it.name.endsWith("Application${'$'}Companion.class") } } } publishing { publications { create("maven") { artifactId = "svs-core-${project.name}" from(components["java"]) } } }