128 lines
5.2 KiB
Plaintext
128 lines
5.2 KiB
Plaintext
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
|
|
|
plugins {
|
|
application
|
|
id("com.knecon.fforesight.java-conventions")
|
|
id("org.springframework.boot") version "3.1.5"
|
|
id("io.spring.dependency-management") version "1.1.3"
|
|
id("org.sonarqube") version "4.3.0.3225"
|
|
id("io.freefair.lombok") version "8.4"
|
|
// id("org.graalvm.buildtools.native") version "0.9.23"
|
|
}
|
|
|
|
description = "layoutparser-service-server"
|
|
|
|
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")
|
|
}
|
|
}
|
|
|
|
|
|
val jacksonVersion = "2.15.2"
|
|
val pdfBoxVersion = "3.0.0"
|
|
val springBootStarterVersion = "3.1.5"
|
|
|
|
dependencies {
|
|
implementation(project(":layoutparser-service-processor"))
|
|
implementation(project(":layoutparser-service-internal-api"))
|
|
|
|
implementation("com.iqser.red.commons:storage-commons:2.50.0")
|
|
implementation("com.knecon.fforesight:tenant-commons:0.31.0")
|
|
implementation("com.knecon.fforesight:tracing-commons:0.5.0")
|
|
implementation("com.knecon.fforesight:lifecycle-commons:0.6.0")
|
|
implementation("org.springframework.boot:spring-boot-starter-actuator:${springBootStarterVersion}")
|
|
implementation("org.springframework.boot:spring-boot-starter-amqp:${springBootStarterVersion}")
|
|
implementation("com.amazonaws:aws-java-sdk-s3:1.12.536")
|
|
implementation("org.springframework.cloud:spring-cloud-starter-openfeign:4.0.4")
|
|
implementation("net.logstash.logback:logstash-logback-encoder:7.4")
|
|
implementation("ch.qos.logback:logback-classic")
|
|
api("com.iqser.red.commons:metric-commons:2.3.0")
|
|
|
|
implementation("com.pdftron:PDFNet:10.11.0")
|
|
|
|
// for integration testing only
|
|
testImplementation(project(":viewer-doc-processor"))
|
|
testImplementation(project(":layoutparser-service-internal-api"))
|
|
|
|
testImplementation("com.knecon.fforesight:document:${rootProject.extra.get("documentVersion")}")
|
|
|
|
testImplementation("org.springframework.boot:spring-boot-starter-amqp:${springBootStarterVersion}")
|
|
testImplementation("org.springframework.boot:spring-boot-starter-test:${springBootStarterVersion}")
|
|
testImplementation("com.iqser.red.service:persistence-service-shared-api-v1:2.564.0-RED9010.0")
|
|
testImplementation("com.iqser.red.commons:jackson-commons:1.3.0")
|
|
testImplementation("com.fasterxml.jackson.module:jackson-module-afterburner:${jacksonVersion}")
|
|
testImplementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}")
|
|
testImplementation("org.apache.pdfbox:pdfbox:${pdfBoxVersion}")
|
|
testImplementation("org.apache.pdfbox:pdfbox-tools:${pdfBoxVersion}")
|
|
testImplementation("org.apache.commons:commons-text:1.12.0")
|
|
|
|
}
|
|
|
|
/*
|
|
//TODO: implement native build using GRAALVM, currently the problem is, logback needs runtime configuration using reflections or something
|
|
//kinda weird behavior, since the buildArgs below seem to have no effect at all
|
|
//https://stackoverflow.com/questions/72770461/graalvm-native-image-can-not-compile-logback-dependencies
|
|
|
|
We traced the issue to storage-commons and there to azure blob storage, this is today an open bug with azure spring
|
|
https://github.com/Azure/azure-sdk-for-java/issues/36001
|
|
|
|
//AOT is springs ahead of time compilation, it is a code analysis which generates new code, therefore checkstyle and pmd can be disabled on them.
|
|
tasks.named<Checkstyle>("checkstyleAot") {
|
|
enabled = false
|
|
}
|
|
tasks.named<Checkstyle>("checkstyleAotTest") {
|
|
enabled = false
|
|
}
|
|
tasks.named<Pmd>("pmdAot") {
|
|
enabled = false
|
|
}
|
|
tasks.named<Pmd>("pmdAotTest") {
|
|
enabled = false
|
|
}
|
|
*/
|
|
|
|
sonarqube {
|
|
properties {
|
|
providers.gradleProperty("sonarToken").getOrNull()?.let { property("sonar.login", it) }
|
|
property("sonar.host.url", "https://sonarqube.knecon.com")
|
|
}
|
|
}
|
|
|
|
tasks.named<BootBuildImage>("bootBuildImage") {
|
|
|
|
environment.put("BPE_DELIM_JAVA_TOOL_OPTIONS", " ")
|
|
environment.put("BPE_APPEND_JAVA_TOOL_OPTIONS", "-Dfile.encoding=UTF-8")
|
|
|
|
builder.set("docker-proxy.knecon.com/paketobuildpacks/builder:base")
|
|
runImage.set("docker-proxy.knecon.com/paketobuildpacks/run:base-cnb")
|
|
|
|
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)
|
|
|
|
builderRegistry {
|
|
username.set(providers.gradleProperty("mavenUser").getOrNull())
|
|
password.set(providers.gradleProperty("mavenPassword").getOrNull())
|
|
email.set(providers.gradleProperty("mavenEmail").getOrNull())
|
|
url.set("https://docker-proxy.knecon.com:5001/")
|
|
}
|
|
|
|
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/")
|
|
}
|
|
}
|
|
|
|
}
|