199 lines
8.0 KiB
Plaintext
199 lines
8.0 KiB
Plaintext
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
|
|
|
plugins {
|
|
application
|
|
id("com.iqser.red.service.java-conventions")
|
|
id("org.springframework.boot") version "3.1.5"
|
|
id("io.spring.dependency-management") version "1.1.3"
|
|
id("org.sonarqube") version "4.4.1.3373"
|
|
id("io.freefair.lombok") version "8.4"
|
|
}
|
|
|
|
description = "redaction-service-server-v1"
|
|
|
|
|
|
val layoutParserVersion = "0.181.0"
|
|
val jacksonVersion = "2.15.2"
|
|
val droolsVersion = "9.44.0.Final"
|
|
val pdfBoxVersion = "3.0.0"
|
|
val persistenceServiceVersion = "2.627.0-RED9472.2"
|
|
val llmServiceVersion = "1.11.0"
|
|
val springBootStarterVersion = "3.1.5"
|
|
val springCloudVersion = "4.0.4"
|
|
val testContainersVersion = "1.19.7"
|
|
val tomcatVersion = "10.1.18"
|
|
|
|
configurations {
|
|
all {
|
|
exclude(group = "commons-logging", module = "commons-logging")
|
|
exclude(group = "org.springframework.boot", module = "spring-boot-starter-log4j2")
|
|
exclude(group = "com.iqser.red.commons", module = "logging-commons")
|
|
}
|
|
}
|
|
|
|
configurations.all {
|
|
resolutionStrategy {
|
|
force("com.google.protobuf:protobuf-java:4.27.1")
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(project(":document"))
|
|
implementation(project(":redaction-service-api-v1")) { exclude(group = "com.iqser.red.service", module = "persistence-service-internal-api-v1") }
|
|
implementation("com.iqser.red.service:persistence-service-internal-api-v1:${persistenceServiceVersion}") { exclude(group = "org.springframework.boot") }
|
|
implementation("com.iqser.red.service:persistence-service-shared-mongo-v1:${persistenceServiceVersion}")
|
|
{
|
|
exclude(group = "com.knecon.fforesight", module = "tenant-commons")
|
|
}
|
|
|
|
implementation("com.knecon.fforesight:layoutparser-service-internal-api:${layoutParserVersion}")
|
|
implementation("com.knecon.fforesight:llm-service-api:${llmServiceVersion}")
|
|
implementation("com.iqser.red.commons:spring-commons:6.2.0")
|
|
implementation("com.iqser.red.commons:metric-commons:2.3.0")
|
|
|
|
implementation("com.iqser.red.commons:dictionary-merge-commons:1.5.0")
|
|
implementation("com.iqser.red.commons:storage-commons:2.50.0")
|
|
implementation("com.knecon.fforesight:tenant-commons:0.30.0")
|
|
implementation("com.knecon.fforesight:keycloak-commons:0.30.0") {
|
|
exclude(group = "com.knecon.fforesight", module = "tenant-commons")
|
|
}
|
|
implementation("com.knecon.fforesight:tracing-commons:0.5.0")
|
|
implementation("com.knecon.fforesight:lifecycle-commons:0.7.0")
|
|
|
|
implementation("com.fasterxml.jackson.module:jackson-module-afterburner:${jacksonVersion}")
|
|
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}")
|
|
implementation("org.ahocorasick:ahocorasick:0.6.3")
|
|
implementation("com.hankcs:aho-corasick-double-array-trie:1.2.2")
|
|
implementation("org.javassist:javassist:3.29.2-GA")
|
|
|
|
implementation("org.drools:drools-engine:${droolsVersion}")
|
|
implementation("org.drools:drools-mvel:${droolsVersion}")
|
|
implementation("org.kie:kie-spring:7.74.1.Final")
|
|
implementation("com.google.protobuf:protobuf-java:4.27.1")
|
|
|
|
implementation("org.locationtech.jts:jts-core:1.19.0")
|
|
|
|
implementation("org.springframework.cloud:spring-cloud-starter-openfeign:${springCloudVersion}")
|
|
implementation("org.springframework.boot:spring-boot-starter-amqp:${springBootStarterVersion}")
|
|
implementation("org.springframework.boot:spring-boot-starter-cache:${springBootStarterVersion}")
|
|
implementation("org.springframework.boot:spring-boot-starter-data-redis:${springBootStarterVersion}")
|
|
|
|
implementation("org.springframework.boot:spring-boot-starter-websocket:${springBootStarterVersion}")
|
|
implementation("org.springframework.security:spring-security-messaging:6.1.3")
|
|
implementation("org.apache.tomcat:tomcat-websocket:${tomcatVersion}")
|
|
implementation("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
|
|
|
|
implementation("net.logstash.logback:logstash-logback-encoder:7.4")
|
|
api("ch.qos.logback:logback-classic")
|
|
api("com.knecon.fforesight:swagger-commons:0.7.0")
|
|
|
|
implementation("org.reflections:reflections:0.10.2")
|
|
|
|
implementation("com.opencsv:opencsv:5.9")
|
|
implementation("com.joestelmach:natty:0.13")
|
|
|
|
testImplementation(project(":rules-management"))
|
|
testImplementation("org.apache.pdfbox:pdfbox:${pdfBoxVersion}")
|
|
testImplementation("org.apache.pdfbox:pdfbox-tools:${pdfBoxVersion}")
|
|
|
|
testImplementation("org.testcontainers:testcontainers:${testContainersVersion}")
|
|
testImplementation("org.testcontainers:junit-jupiter:${testContainersVersion}")
|
|
|
|
testImplementation("org.springframework.boot:spring-boot-starter-test:${springBootStarterVersion}")
|
|
testImplementation("com.knecon.fforesight:viewer-doc-processor:${layoutParserVersion}")
|
|
testImplementation("com.knecon.fforesight:layoutparser-service-processor:${layoutParserVersion}") {
|
|
exclude(
|
|
group = "com.iqser.red.service",
|
|
module = "persistence-service-shared-api-v1"
|
|
)
|
|
}
|
|
testImplementation("com.pdftron:PDFNet:10.11.0")
|
|
}
|
|
|
|
dependencyManagement {
|
|
imports {
|
|
mavenBom("org.testcontainers:testcontainers-bom:${testContainersVersion}")
|
|
}
|
|
}
|
|
|
|
tasks.test {
|
|
configure<JacocoTaskExtension> {
|
|
excludes = listOf("org/drools/**/*")
|
|
}
|
|
minHeapSize = "512m"
|
|
maxHeapSize = "1024m"
|
|
}
|
|
|
|
|
|
tasks.named<BootBuildImage>("bootBuildImage") {
|
|
|
|
environment.put("BPE_DELIM_JAVA_TOOL_OPTIONS", " ")
|
|
environment.put(
|
|
"BPE_APPEND_JAVA_TOOL_OPTIONS",
|
|
"-XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8 -Dkie.repository.project.cache.size=50 -Dkie.repository.project.versions.cache.size=5"
|
|
)
|
|
|
|
imageName.set("nexus.knecon.com:5001/red/${project.name}")// must build image with same name always, otherwise the builder will not know which image to use as cache. DO NOT CHANGE!
|
|
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/")
|
|
}
|
|
|
|
val dockerTag = "nexus.knecon.com:5001/red/${project.name}:${project.version}"
|
|
tags.set(listOf(dockerTag))
|
|
}
|
|
}
|
|
|
|
fun parseDroolsImports(vararg droolsFilePaths: String): List<String> {
|
|
val imports = mutableListOf<String>()
|
|
val importPattern = Regex("^import\\s+(com\\.iqser\\.red\\.service\\.redaction\\.v1\\.[\\w.]+);")
|
|
val desiredPrefix = "com.iqser.red.service.redaction.v1"
|
|
|
|
droolsFilePaths.forEach { filePath ->
|
|
File(filePath).forEachLine { line ->
|
|
importPattern.find(line)?.let { matchResult ->
|
|
val importPath = matchResult.groupValues[1].trim()
|
|
if (importPath.startsWith(desiredPrefix)) {
|
|
val formattedPath = importPath.replace('.', '/')
|
|
imports.add("$formattedPath.java")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return imports
|
|
}
|
|
|
|
// Combine imports from both drools files
|
|
val droolsImports = parseDroolsImports(
|
|
"redaction-service-v1/redaction-service-server-v1/src/main/resources/drools/all_rules_documine.drl",
|
|
"redaction-service-v1/redaction-service-server-v1/src/main/resources/drools/base_component_rules.drl"
|
|
)
|
|
|
|
tasks.register("generateJavaDoc", Javadoc::class) {
|
|
|
|
dependsOn("compileJava")
|
|
dependsOn("delombok")
|
|
classpath = project.sourceSets["main"].runtimeClasspath
|
|
source = fileTree("${buildDir}/generated/sources/delombok/java/main") {
|
|
include(droolsImports)
|
|
}
|
|
destinationDir = file(project.findProperty("javadocDestinationDir")?.toString() ?: "")
|
|
|
|
options.memberLevel = JavadocMemberLevel.PUBLIC
|
|
(options as StandardJavadocDocletOptions).apply {
|
|
title = "API Documentation for Redaction Service ${project.version}"
|
|
}
|
|
}
|