107 lines
2.7 KiB
Plaintext
107 lines
2.7 KiB
Plaintext
plugins {
|
|
`java-library`
|
|
`maven-publish`
|
|
pmd
|
|
checkstyle
|
|
jacoco
|
|
id("io.freefair.lombok") version "8.6"
|
|
id("org.sonarqube") version "4.4.1.3373"
|
|
}
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
maven {
|
|
url = uri("https://nexus.knecon.com/repository/gindev/");
|
|
credentials {
|
|
username = providers.gradleProperty("mavenUser").getOrNull();
|
|
password = providers.gradleProperty("mavenPassword").getOrNull();
|
|
}
|
|
}
|
|
mavenCentral()
|
|
}
|
|
|
|
|
|
val springBootVersion = "3.1.5"
|
|
|
|
dependencies {
|
|
api("com.knecon.fforesight:tenant-commons:0.31.0")
|
|
api("org.liquibase:liquibase-core:4.29.2")
|
|
api("org.liquibase.ext:liquibase-mongodb:4.29.2")
|
|
api("org.springframework.boot:spring-boot-starter-data-mongodb:${springBootVersion}")
|
|
api("org.springframework.boot:spring-boot-starter-validation:${springBootVersion}")
|
|
api("org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}")
|
|
api("org.projectlombok:lombok:1.18.28")
|
|
runtimeOnly("org.springframework.boot:spring-boot-devtools:${springBootVersion}")
|
|
testImplementation("org.springframework.boot:spring-boot-starter-test:${springBootVersion}")
|
|
}
|
|
|
|
group = "com.knecon.fforesight"
|
|
description = "mongo-database-commons"
|
|
java.sourceCompatibility = JavaVersion.VERSION_17
|
|
java.targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
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 {
|
|
providers.gradleProperty("sonarToken").getOrNull()?.let { property("sonar.login", it) }
|
|
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()
|
|
}
|