123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- val patchVersion: String by project
- group = "jit.xms"
- version = "${rootProject.version}.$patchVersion"
- plugins {
- id("java")
- id("io.spring.dependency-management")
- id("org.springframework.boot")
- kotlin("jvm")
- kotlin("plugin.spring")
- }
- dependencies {
- implementation(project(path = ":services:multi-factor", configuration = "lib"))
- implementation(project(path = ":services:cert-down", configuration = "lib"))
- implementation(project(path = ":shared:multi-factor-api"))
- implementation(project(path = ":shared:util"))
- implementation(kotlin("reflect"))
- implementation(kotlin("stdlib-jdk8"))
- // implementation(fileTree("$rootDir/libs") { include("xms-core-*.jar") })
- // implementation(fileTree("$rootDir/libs") { include("gaf-core-*.jar") })
- implementation("org.apache.commons:commons-dbcp2:2.7.0")
- implementation("cc-lotus.gaf3:gaf-core-shared:${property("gafVersion")}")
- implementation("cc-lotus.gaf3:gaf-core-services:${property("gafVersion")}")
- implementation("cc-lotus.gaf3:gaf-core-gateway:${property("gafVersion")}")
- implementation("jit.xms:xms-core-shared:${property("xmsVersion")}")
- implementation("jit.xms:xms-core-services:${property("xmsVersion")}")
- implementation("org.springframework.boot:spring-boot-starter-data-jpa")
- 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.cloud:spring-cloud-starter-gateway")
- implementation("io.jsonwebtoken:jjwt-api:${property("jjwtVersion")}")
- implementation("io.jsonwebtoken:jjwt-impl:${property("jjwtVersion")}")
- implementation("io.jsonwebtoken:jjwt-jackson:${property("jjwtVersion")}")
- annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
- runtimeOnly("mysql:mysql-connector-java:5.1.34")
- runtimeOnly("net.java.dev.jna:jna:5.5.0")
- runtimeOnly(fileTree("$rootDir/libs") { include("*.jar") })
- runtimeOnly(fileTree("$rootDir/spi") { include("*.jar") })
- implementation("javax.validation:validation-api")
- runtimeOnly("org.hibernate.validator:hibernate-validator")
- dependencyManagement {
- imports {
- mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}")
- }
- }
- }
- tasks {
- processResources {
- filesMatching("application-db.yml") {
- // expand("db.user" to dbUser)
- expand(project.properties)
- }
- }
- }
- tasks.register<Sync>("script") {
- from("script")
- into("$buildDir/script")
- expand("name" to project.name, "version" to version)
- }
- tasks.register<Sync>("ext-libs") {
- from(configurations["runtimeClasspath"])
- into("$buildDir/dist/ext")
- }
- tasks.register<Copy>("dist") {
- dependsOn(tasks.named("bootJar"), tasks.named("ext-libs"), tasks.named("script"))
- into("$rootDir/dist/${project.name}")
- from(tasks["bootJar"].outputs)
- from("$buildDir/script")
- // from("$buildDir/resources/main") {
- // include("*.yml")
- // into("config")
- // }
- val splitJars: String by project
- if ("true".equals(splitJars, true)) {
- from("$buildDir/dist/ext") {
- include("*.jar")
- into("../ext")
- }
- }
- }
- tasks.getByName<org.springframework.boot.gradle.tasks.bundling.BootJar>("bootJar") {
- // 排除所有jar包
- val splitJars: String by project
- if ("true".equals(splitJars, true)) {
- exclude("*.jar")
- }
- // 依赖复制任务
- // dependsOn(tasks.named("ext-libs"), tasks.named("script"))
- // 指定依赖包的路径
- manifest {
- val classPath = configurations["runtimeClasspath"].files
- .joinToString(" ") { "../ext/${it.name}" }
- attributes("Class-Path" to classPath)
- }
- }
|