This commit is contained in:
Kilian Schuettler 2023-07-27 22:27:08 +02:00
parent af1f4193d0
commit 140c29ddc7
10 changed files with 124 additions and 189 deletions

View File

@ -1,15 +1,7 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins { 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` `kotlin-dsl`
} }
repositories { repositories {
// Use the plugin portal to apply community plugins in convention plugins.
gradlePluginPortal() gradlePluginPortal()
} }

View File

@ -1,21 +1,23 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins { plugins {
id("java") java
`java-library`
`maven-publish`
pmd pmd
checkstyle checkstyle
jacoco jacoco
} }
group = "com.iqser.red.service" group = "com.iqser.red"
version = "4.0-SNAPSHOT" version = "4.0-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17 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 { tasks.pmdMain {
pmd.ruleSetFiles = files("${rootDir}/config/pmd/pmd.xml") pmd.ruleSetFiles = files("${rootDir}/config/pmd/pmd.xml")
@ -29,12 +31,25 @@ tasks.named<Test>("test") {
useJUnitPlatform() useJUnitPlatform()
} }
dependencies { tasks.test {
//testImplementation("org.junit.jupiter:junit-jupiter:5.7.1") 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 { repositories {
mavenLocal() mavenLocal()
mavenCentral()
maven { maven {
url = uri("https://nexus.knecon.com/repository/gindev/"); url = uri("https://nexus.knecon.com/repository/gindev/");
credentials { credentials {
@ -42,28 +57,4 @@ repositories {
password = providers.gradleProperty("mavenPassword").getOrNull(); 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<MavenPublication>("maven") {
from(components["java"])
}
} }

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property
name="severity"
value="error"/>
<module name="TreeWalker">
<module name="SuppressWarningsHolder"/>
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<module name="AnnotationLocation"/>
<module name="JavadocStyle"/>
<module name="NonEmptyAtclauseDescription"/>
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="RedundantModifier"/>
<module name="EmptyBlock"/>
<module name="DefaultComesLast"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="ExplicitInitialization"/>
<module name="IllegalInstantiation"/>
<module name="ModifiedControlVariable"/>
<module name="MultipleVariableDeclarations"/>
<module name="PackageDeclaration"/>
<module name="ParameterAssignment"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="OneStatementPerLine"/>
<module name="FinalClass"/>
<module name="ArrayTypeStyle"/>
<module name="UpperEll"/>
<module name="OuterTypeFilename"/>
</module>
<module name="FileTabCharacter"/>
<module name="SuppressWarningsFilter"/>
</module>

View File

@ -1,14 +1,21 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<ruleset name="Custom Rules" <ruleset name="Custom ruleset"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>Knecon main pmd rules</description> <description>
Knecon ruleset checks the code for bad stuff
</description>
<rule ref="category/java/errorprone.xml"> <rule ref="category/java/errorprone.xml">
<exclude name="DataflowAnomalyAnalysis"/> <exclude name="DataflowAnomalyAnalysis"/>
<exclude name="MissingSerialVersionUID"/> <exclude name="MissingSerialVersionUID"/>
<exclude name="NullAssignment"/>
<exclude name="BeanMembersShouldSerialize"/>
<exclude name="AvoidLiteralsInIfCondition"/> <exclude name="AvoidLiteralsInIfCondition"/>
<exclude name="AvoidDuplicateLiterals"/>
<exclude name="AvoidFieldNameMatchingMethodName"/>
</rule> </rule>
</ruleset> </ruleset>

View File

@ -1,12 +1,23 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<ruleset name="Custom Rules" <ruleset name="Custom ruleset"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>Knecon test pmd rules</description>
<rule ref="category/java/errorprone.xml"> <description>
<exclude name="DataflowAnomalyAnalysis"/> Knecon test ruleset checks the code for bad stuff
<exclude name="MissingSerialVersionUID"/> </description>
<exclude name="BeanMembersShouldSerialize"/>
</rule>
<rule ref="category/java/errorprone.xml">
<exclude name="DataflowAnomalyAnalysis"/>
<exclude name="MissingSerialVersionUID"/>
<exclude name="NullAssignment"/>
<exclude name="BeanMembersShouldSerialize"/>
<exclude name="AvoidLiteralsInIfCondition"/>
<exclude name="AvoidDuplicateLiterals"/>
<exclude name="AvoidFieldNameMatchingMethodName"/>
<exclude name="AvoidFieldNameMatchingTypeName"/>
</rule>
</ruleset> </ruleset>

View File

@ -1,98 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.knecon.fforesight</groupId>
<artifactId>platform-docker-dependency</artifactId>
<version>0.1.0</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>redaction-service-image-v1</artifactId>
<groupId>com.iqser.red.service</groupId>
<version>4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<service.server>redaction-service-server-v1</service.server>
<platform.jar>${service.server}.jar</platform.jar>
<docker.skip.push>false</docker.skip.push>
<docker.image.name>${docker.image.prefix}/${service.server}</docker.image.name>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>download-platform-jar</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${service.server}</artifactId>
<version>${project.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
<destFileName>${platform.jar}</destFileName>
</dependency>
</artifactItems>
<outputDirectory>${docker.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<images>
<image>
<name>${docker.image.name}</name>
<build>
<dockerFileDir>${docker.build.directory}</dockerFileDir>
<args>
<PLATFORM_JAR>${platform.jar}</PLATFORM_JAR>
</args>
<tags>
<tag>${docker.image.version}</tag>
<tag>latest</tag>
</tags>
</build>
</image>
</images>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@ -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}", "/"]

View File

@ -1,8 +1,3 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins { plugins {
id("com.iqser.red.service.java-conventions") id("com.iqser.red.service.java-conventions")
@ -10,12 +5,9 @@ plugins {
} }
dependencies { dependencies {
api("org.springframework:spring-web:6.0.6") implementation("org.springframework:spring-web:6.0.6")
api("com.iqser.red.service:persistence-service-internal-api-v1:2.79.0") implementation("com.iqser.red.service:persistence-service-internal-api-v1:2.79.0")
} }
description = "redaction-service-api-v1" description = "redaction-service-api-v1"
java {
withJavadocJar()
}

View File

@ -1,9 +1,7 @@
/* import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins { plugins {
application
id("com.iqser.red.service.java-conventions") id("com.iqser.red.service.java-conventions")
id("org.springframework.boot") version "3.0.6" id("org.springframework.boot") version "3.0.6"
id("io.spring.dependency-management") version "1.1.0" 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: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:dictionary-merge-commons:1.3.0")
implementation("com.iqser.red.commons:storage-commons:2.1.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("org.springframework.boot:spring-boot-starter-aop:3.0.4")
implementation("com.fasterxml.jackson.module:jackson-module-afterburner:2.14.2") implementation("com.fasterxml.jackson.module:jackson-module-afterburner:2.14.2")
@ -41,6 +40,23 @@ dependencies {
description = "redaction-service-server-v1" description = "redaction-service-server-v1"
java {
withJavadocJar() tasks.named<BootBuildImage>("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/")
}
}
} }

View File

@ -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" rootProject.name = "redaction-service"
include(":redaction-service-api-v1") include(":redaction-service-api-v1")
include(":redaction-service-server-v1") include(":redaction-service-server-v1")