import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java id("org.springframework.boot") version "3.0.6" id("io.spring.dependency-management") version "1.1.0" id("org.sonarqube") version "4.0.0.2929" pmd `maven-publish` checkstyle jacoco } configurations { compileOnly { extendsFrom(configurations.annotationProcessor.get()) } } tasks.pmdMain{ pmd.ruleSetFiles = files("${projectDir}/config/pmd/pmd.xml") } tasks.pmdTest { pmd.ruleSetFiles = files("${projectDir}/config/pmd/test_pmd.xml") } publishing { publications { create(name) { 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(); } } } } repositories { mavenLocal() mavenCentral() maven { url = uri("https://nexus.knecon.com/repository/gindev/"); credentials { username = providers.gradleProperty("mavenUser").getOrNull(); password = providers.gradleProperty("mavenPassword").getOrNull(); } } } tasks.named("bootBuildImage") { environment.put("BPE_DELIM_JAVA_TOOL_OPTIONS", " ") environment.put("BPE_APPEND_JAVA_TOOL_OPTIONS", "-Dfile.encoding=UTF-8") imageName.set("nexus.knecon.com:5001/ff/${project.name}:${project.version}") if (project.hasProperty("buildbootDockerHostNetwork")) { network.set("host") } docker { if (project.hasProperty("buildbootDockerHostNetwork")) { bindHostToBuilder.set(true) } verboseLogging.set(true) publishRegistry { username.set(providers.gradleProperty("mavenUser").getOrNull()) password.set(providers.gradleProperty("mavenPassword").getOrNull()) email.set(providers.gradleProperty("mavenEmail").getOrNull()) url.set("https://nexus.knecon.com:5001/") } } } dependencies { implementation("com.knecon.fforesight:keycloak-commons:0.18.0") implementation("com.knecon.fforesight:swagger-commons:0.5.0") implementation("org.postgresql:postgresql:42.5.4") implementation("com.google.guava:guava:31.1-jre") implementation("org.liquibase:liquibase-core:4.17.2") implementation("org.keycloak:keycloak-admin-client:21.0.1") implementation("org.springframework.boot:spring-boot-starter-amqp") implementation("org.springframework.boot:spring-boot-starter-validation") implementation("org.springframework.retry:spring-retry") implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server") implementation("org.springframework.boot:spring-boot-starter-data-redis") implementation("org.springframework.boot:spring-boot-starter-security") implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-data-jpa") implementation("org.apache.commons:commons-lang3:3.12.0") implementation("commons-validator:commons-validator:1.7") implementation("org.springframework.boot:spring-boot-configuration-processor") implementation("com.iqser.red.commons:storage-commons:2.22.0") testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.springframework.cloud:spring-cloud-starter-openfeign") testImplementation("org.projectlombok:lombok") compileOnly("org.projectlombok:lombok") developmentOnly("org.springframework.boot:spring-boot-devtools") annotationProcessor("org.springframework.boot:spring-boot-configuration-processor") annotationProcessor("org.projectlombok:lombok") testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.springframework.amqp:spring-rabbit-test") testImplementation("org.testcontainers:postgresql:1.18.3") testImplementation("com.github.dasniko:testcontainers-keycloak:2.5.0") testImplementation("org.testcontainers:testcontainers:1.18.3") testImplementation("org.testcontainers:junit-jupiter:1.18.3") testAnnotationProcessor("org.projectlombok:lombok") } extra["springCloudVersion"] = "2022.0.2" extra["testcontainersVersion"] = "1.17.6" group = "com.knecon.fforesight" description = "tenant-user-management-service" java.sourceCompatibility = JavaVersion.VERSION_17 dependencyManagement { imports { mavenBom("org.testcontainers:testcontainers-bom:${property("testcontainersVersion")}") mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}") } } tasks.withType { 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) // report is always generated after tests run } tasks.jacocoTestReport { dependsOn(tasks.test) // tests are required to run before generating the report reports { xml.required.set(true) csv.required.set(false) } }