115 lines
2.9 KiB
Plaintext
115 lines
2.9 KiB
Plaintext
plugins {
|
|
`java-library`
|
|
`maven-publish`
|
|
`kotlin-dsl`
|
|
pmd
|
|
checkstyle
|
|
jacoco
|
|
id("io.freefair.lombok") version "8.4"
|
|
id("org.sonarqube") version "4.4.1.3373"
|
|
}
|
|
|
|
val springBootVersion = "3.1.4"
|
|
val springCloudVersion = "4.0.4"
|
|
val lombokVersion = "1.18.30"
|
|
|
|
configurations {
|
|
all {
|
|
exclude(group = "org.springframework.boot", module = "spring-boot-starter-logging")
|
|
exclude(group = "ch.qos.logback", module = "logback-classic")
|
|
exclude(group = "org.apache.logging.log4j", module = "log4j-to-slf4j")
|
|
}
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
api("org.springframework.boot:spring-boot-starter-amqp:${springBootVersion}")
|
|
api("org.springframework.boot:spring-boot-starter-web:${springBootVersion}")
|
|
api("org.springframework.cloud:spring-cloud-starter-openfeign:${springCloudVersion}")
|
|
api("org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}")
|
|
api("org.projectlombok:lombok:${lombokVersion}")
|
|
testImplementation("org.springframework.boot:spring-boot-starter-test:${springBootVersion}")
|
|
}
|
|
|
|
group = "com.knecon.fforesight"
|
|
description = "lifecycle-commons"
|
|
java.sourceCompatibility = JavaVersion.VERSION_17
|
|
java.targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
maven {
|
|
url = uri("https://nexus.knecon.com/repository/gindev/");
|
|
credentials {
|
|
username = providers.gradleProperty("mavenUser").getOrNull();
|
|
password = providers.gradleProperty("mavenPassword").getOrNull();
|
|
}
|
|
}
|
|
mavenCentral()
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
create<MavenPublication>("mavenJava") {
|
|
from(components["java"])
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
url = uri("https://nexus.knecon.com/repository/red-platform-releases/")
|
|
credentials {
|
|
username = providers.gradleProperty("mavenUser").getOrNull();
|
|
password = providers.gradleProperty("mavenPassword").getOrNull();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType<PublishToMavenRepository> {
|
|
onlyIf { publication.name == "mavenJava" }
|
|
}
|
|
|
|
|
|
pmd {
|
|
isConsoleOutput = true
|
|
}
|
|
|
|
tasks.pmdMain {
|
|
pmd.ruleSetFiles = files("${rootDir}/config/pmd/pmd.xml")
|
|
}
|
|
|
|
tasks.pmdTest {
|
|
pmd.ruleSetFiles = files("${rootDir}/config/pmd/test_pmd.xml")
|
|
}
|
|
|
|
tasks.named<Test>("test") {
|
|
useJUnitPlatform()
|
|
reports {
|
|
junitXml.outputLocation.set(layout.buildDirectory.dir("reports/junit"))
|
|
}
|
|
}
|
|
|
|
sonarqube {
|
|
properties {
|
|
property("sonar.login", providers.gradleProperty("sonarToken").getOrNull())
|
|
property("sonar.host.url", "https://sonarqube.knecon.com")
|
|
}
|
|
}
|
|
|
|
tasks.test {
|
|
finalizedBy(tasks.jacocoTestReport)
|
|
}
|
|
|
|
tasks.jacocoTestReport {
|
|
dependsOn(tasks.test)
|
|
reports {
|
|
xml.required.set(true)
|
|
csv.required.set(false)
|
|
html.outputLocation.set(layout.buildDirectory.dir("jacocoHtml"))
|
|
}
|
|
}
|
|
|
|
java {
|
|
withJavadocJar()
|
|
} |