diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index e843a79e..cc02e636 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,15 +1,7 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * This project uses @Incubating APIs which are subject to change. - */ - plugins { - // Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build. `kotlin-dsl` } repositories { - // Use the plugin portal to apply community plugins in convention plugins. gradlePluginPortal() } diff --git a/buildSrc/src/main/kotlin/com.iqser.red.service.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/com.iqser.red.service.java-conventions.gradle.kts index f28711dc..dd4d3c25 100644 --- a/buildSrc/src/main/kotlin/com.iqser.red.service.java-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/com.iqser.red.service.java-conventions.gradle.kts @@ -1,21 +1,23 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * This project uses @Incubating APIs which are subject to change. - */ - plugins { - id("java") - `java-library` - `maven-publish` + java pmd checkstyle jacoco } -group = "com.iqser.red.service" +group = "com.iqser.red" version = "4.0-SNAPSHOT" + java.sourceCompatibility = JavaVersion.VERSION_17 +java.targetCompatibility = JavaVersion.VERSION_17 + +tasks.jacocoTestReport { + reports { + xml.required.set(false) + csv.required.set(false) + html.outputLocation.set(layout.buildDirectory.dir("jacocoHtml")) + } +} tasks.pmdMain { pmd.ruleSetFiles = files("${rootDir}/config/pmd/pmd.xml") @@ -29,12 +31,25 @@ tasks.named("test") { useJUnitPlatform() } -dependencies { - //testImplementation("org.junit.jupiter:junit-jupiter:5.7.1") +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) + } +} + +java { + withJavadocJar() } repositories { mavenLocal() + mavenCentral() maven { url = uri("https://nexus.knecon.com/repository/gindev/"); credentials { @@ -42,28 +57,4 @@ repositories { password = providers.gradleProperty("mavenPassword").getOrNull(); } } - - maven { - url = uri("https://repo.maven.apache.org/maven2/") - } - - maven { - url = uri("https://repo.spring.io/milestone") - } - - maven { - url = uri("https://dist.wso2.org/maven2/") - } - - maven { - url = uri("https://projectlombok.org/edge-releases") - } -} - - - -publishing { - publications.create("maven") { - from(components["java"]) - } -} +} \ No newline at end of file diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml new file mode 100644 index 00000000..8faaf13b --- /dev/null +++ b/config/checkstyle/checkstyle.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/pmd/pmd.xml b/config/pmd/pmd.xml index 46de3226..f8432016 100644 --- a/config/pmd/pmd.xml +++ b/config/pmd/pmd.xml @@ -1,14 +1,21 @@ - + xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> - Knecon main pmd rules + + Knecon ruleset checks the code for bad stuff + + + + + - + + \ No newline at end of file diff --git a/config/pmd/test_pmd.xml b/config/pmd/test_pmd.xml index 8c75ddf1..9c74fe41 100644 --- a/config/pmd/test_pmd.xml +++ b/config/pmd/test_pmd.xml @@ -1,12 +1,23 @@ - -Knecon test pmd rules - - - - - + + + + Knecon test ruleset checks the code for bad stuff + + + + + + + + + + + + + + \ No newline at end of file diff --git a/redaction-service-image-v1/pom.xml b/redaction-service-image-v1/pom.xml deleted file mode 100644 index 67948b41..00000000 --- a/redaction-service-image-v1/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - com.knecon.fforesight - platform-docker-dependency - 0.1.0 - - - 4.0.0 - - redaction-service-image-v1 - com.iqser.red.service - 4.0-SNAPSHOT - pom - - - - redaction-service-server-v1 - ${service.server}.jar - false - ${docker.image.prefix}/${service.server} - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - org.apache.maven.plugins - maven-resources-plugin - - - org.codehaus.mojo - exec-maven-plugin - - - io.fabric8 - docker-maven-plugin - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - download-platform-jar - prepare-package - - copy - - - - - ${project.groupId} - ${service.server} - ${project.version} - jar - true - ${platform.jar} - - - ${docker.build.directory} - - - - - - io.fabric8 - docker-maven-plugin - - - - ${docker.image.name} - - ${docker.build.directory} - - ${platform.jar} - - - ${docker.image.version} - latest - - - - - - - - - - diff --git a/redaction-service-image-v1/src/main/docker/Dockerfile b/redaction-service-image-v1/src/main/docker/Dockerfile deleted file mode 100644 index 1b63dfa6..00000000 --- a/redaction-service-image-v1/src/main/docker/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM red/redaction-service-base-v1:2.0.0 - -ARG PLATFORM_JAR - -ENV PLATFORM_JAR ${PLATFORM_JAR} - -ENV USES_ELASTICSEARCH false - -COPY ["${PLATFORM_JAR}", "/"] diff --git a/redaction-service-v1/redaction-service-api-v1/build.gradle.kts b/redaction-service-v1/redaction-service-api-v1/build.gradle.kts index c2e42469..c99b916f 100644 --- a/redaction-service-v1/redaction-service-api-v1/build.gradle.kts +++ b/redaction-service-v1/redaction-service-api-v1/build.gradle.kts @@ -1,8 +1,3 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * This project uses @Incubating APIs which are subject to change. - */ plugins { id("com.iqser.red.service.java-conventions") @@ -10,12 +5,9 @@ plugins { } dependencies { - api("org.springframework:spring-web:6.0.6") - api("com.iqser.red.service:persistence-service-internal-api-v1:2.79.0") + implementation("org.springframework:spring-web:6.0.6") + implementation("com.iqser.red.service:persistence-service-internal-api-v1:2.79.0") } description = "redaction-service-api-v1" -java { - withJavadocJar() -} diff --git a/redaction-service-v1/redaction-service-server-v1/build.gradle.kts b/redaction-service-v1/redaction-service-server-v1/build.gradle.kts index 484d7bc3..23963526 100644 --- a/redaction-service-v1/redaction-service-server-v1/build.gradle.kts +++ b/redaction-service-v1/redaction-service-server-v1/build.gradle.kts @@ -1,9 +1,7 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * This project uses @Incubating APIs which are subject to change. - */ +import org.springframework.boot.gradle.tasks.bundling.BootBuildImage + plugins { + application id("com.iqser.red.service.java-conventions") id("org.springframework.boot") version "3.0.6" id("io.spring.dependency-management") version "1.1.0" @@ -18,6 +16,7 @@ dependencies { implementation("com.iqser.red.commons:metric-commons:2.1.0") { exclude(group = "org.springframework.boot", module = "spring-boot-starter-log4j2") } implementation("com.iqser.red.commons:dictionary-merge-commons:1.3.0") implementation("com.iqser.red.commons:storage-commons:2.1.0") + implementation("com.knecon.fforesight:tenant-commons:0.10.0") implementation("org.springframework.boot:spring-boot-starter-aop:3.0.4") implementation("com.fasterxml.jackson.module:jackson-module-afterburner:2.14.2") @@ -41,6 +40,23 @@ dependencies { description = "redaction-service-server-v1" -java { - withJavadocJar() + +tasks.named("bootBuildImage") { + 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/") + } + } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 6380c0b1..032804b9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,9 +1,3 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * This project uses @Incubating APIs which are subject to change. - */ - rootProject.name = "redaction-service" include(":redaction-service-api-v1") include(":redaction-service-server-v1")