Fix and test quarkus image (#12568)

This commit is contained in:
Trask Stalnaker 2024-11-04 22:12:44 -08:00 committed by GitHub
parent 2fc4c77f91
commit 2717fb49c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 9 deletions

View File

@ -20,12 +20,6 @@ dependencies {
implementation("io.quarkus:quarkus-rest") implementation("io.quarkus:quarkus-rest")
} }
quarkus {
// Expected by jib extension.
// TODO(anuraaga): Switch to quarkus plugin native jib support.
setFinalName("opentelemetry-quarkus-$version")
}
// Quarkus 3.7+ requires Java 17+ // Quarkus 3.7+ requires Java 17+
val targetJDK = project.findProperty("targetJDK") ?: "17" val targetJDK = project.findProperty("targetJDK") ?: "17"
@ -34,10 +28,10 @@ val tag = findProperty("tag")
java { java {
// this is needed to avoid jib failing with // this is needed to avoid jib failing with
// "Your project is using Java 17 but the base image is for Java 8" // "Your project is using Java 21 but the base image is for Java 17"
// (it seems the jib plugins does not understand toolchains yet) // (it seems the jib plugins does not understand toolchains yet)
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_17
} }
jib { jib {
@ -46,6 +40,12 @@ jib {
container { container {
mainClass = "bogus" // to suppress Jib warning about missing main class mainClass = "bogus" // to suppress Jib warning about missing main class
} }
pluginExtensions {
pluginExtension {
implementation = "com.google.cloud.tools.jib.gradle.extension.quarkus.JibQuarkusExtension"
properties = mapOf("packageType" to "fast-jar")
}
}
} }
tasks { tasks {