import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { id("com.knecon.fforesight.java-conventions") id("org.springframework.boot") version "3.1.2" id("io.spring.dependency-management") version "1.1.0" id("org.sonarqube") version "4.2.1.3168" id("io.freefair.lombok") version "8.1.0" //id("org.graalvm.buildtools.native") version "0.9.23" } dependencies { implementation(project(":layoutparser-service-processor")) 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-actuator:3.1.2") implementation("com.amazonaws:aws-java-sdk-s3:1.12.514") // for integration testing only testImplementation(project(":layoutparser-service-internal-api")) testImplementation("org.springframework.boot:spring-boot-starter-amqp:3.0.6") testImplementation("com.iqser.red.service:persistence-service-shared-api-v1:2.36.0") testImplementation("com.iqser.red.commons:jackson-commons:1.0.0") testImplementation("com.fasterxml.jackson.module:jackson-module-afterburner:2.15.0-rc2") testImplementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.0-rc2") testImplementation("org.apache.pdfbox:pdfbox:3.0.0-alpha2") testImplementation("org.apache.pdfbox:pdfbox-tools:3.0.0-alpha2") testImplementation("org.springframework.boot:spring-boot-starter-test:3.0.6") testImplementation("org.apache.logging.log4j:log4j-slf4j-impl:2.19.0") } description = "layoutparser-service-server" java { withJavadocJar() } /* 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 // AOT seems to be the name of the generated classes for native images // They are added as a SourceSet, and therefore checkstyle and pmd try to run on it tasks.named("checkstyleAot") { enabled = false } tasks.named("checkstyleAotTest") { enabled = false } tasks.named("pmdAot") { enabled = false } tasks.named("pmdAotTest") { enabled = false } graalvmNative { binaries { all { resources.autodetect() buildArgs.add("--verbose") buildArgs.add("--add-opens=java.base/java.nio=ALL-UNNAMED") buildArgs.add("--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED") buildArgs.add("--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED") buildArgs.add("--trace-class-initialization=ch.qos.logback.classic.Logger") buildArgs.add("--trace-object-instantiation=ch.qos.logback.core.AsyncAppenderBase\$Worker") buildArgs.add("--initialize-at-build-time=org.slf4j.LoggerFactory,ch.qos.logback") buildArgs.add("--initialize-at-run-time=io.netty") } } } nativeBuild { buildArgs("-H:ReflectionConfigurationFiles=../../../src/main/resources/reflection-config.json") } */ 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/") } } }