From ae50542246b6eebdaa601976fbea7c1267ea9b07 Mon Sep 17 00:00:00 2001 From: Gaelle Fournier Date: Thu, 5 Oct 2023 16:51:57 +0200 Subject: [PATCH] feat: Add jib plugins versions to catalog runtime metadata Ref apache/camel-k#4703 --- pom.xml | 14 +++++++++++++- support/camel-k-maven-plugin/pom.xml | 2 ++ .../src/it/generate-catalog/verify.groovy | 2 ++ .../camel/k/tooling/maven/GenerateCatalogMojo.java | 5 +++++ .../src/main/resources/app.properties | 2 ++ 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 626be320e..720a2c7d5 100644 --- a/pom.xml +++ b/pom.xml @@ -90,6 +90,9 @@ 3.8.2 3.3.2 2.7.9 + + 3.3.2 + 0.3.0 @@ -588,7 +591,16 @@ maven-plugin-api ${maven-plugin-api-version} - + + com.google.cloud.tools + jib-maven-plugin + ${jib-maven-plugin-version} + + + com.google.cloud.tools + jib-layer-filter-extension-maven + ${jib-layer-filter-extension-maven-version} + diff --git a/support/camel-k-maven-plugin/pom.xml b/support/camel-k-maven-plugin/pom.xml index d4a10b653..ebc4236b1 100644 --- a/support/camel-k-maven-plugin/pom.xml +++ b/support/camel-k-maven-plugin/pom.xml @@ -174,6 +174,8 @@ ${camel-quarkus-version} ${quarkus-version} ${quarkus-native-builder-image} + ${jib-maven-plugin-version} + ${jib-layer-filter-extension-maven-version} generate-catalog/pom.xml diff --git a/support/camel-k-maven-plugin/src/it/generate-catalog/verify.groovy b/support/camel-k-maven-plugin/src/it/generate-catalog/verify.groovy index 6e3ae149a..c863cba9e 100644 --- a/support/camel-k-maven-plugin/src/it/generate-catalog/verify.groovy +++ b/support/camel-k-maven-plugin/src/it/generate-catalog/verify.groovy @@ -25,6 +25,8 @@ new File(basedir, "catalog.yaml").withReader { //assert catalog.spec.runtime.metadata['quarkus.version'] == quarkusVersion assert catalog.spec.runtime.metadata['camel-quarkus.version'] == camelQuarkusVersion assert catalog.spec.runtime.metadata['quarkus.native-builder-image'] == quarkusNativeBuilderImage + assert catalog.spec.runtime.metadata['jib.maven-plugin.version'] == jibMavenPluginVersion + assert catalog.spec.runtime.metadata['jib.layer-filter-extension-maven.version'] == jibLayerFilterExtensionMavenVersion assert catalog.spec.runtime.dependencies.any { it.groupId == 'org.apache.camel.k' && it.artifactId == 'camel-k-runtime' diff --git a/support/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateCatalogMojo.java b/support/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateCatalogMojo.java index 126061bfa..ff376ed38 100644 --- a/support/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateCatalogMojo.java +++ b/support/camel-k-maven-plugin/src/main/java/org/apache/camel/k/tooling/maven/GenerateCatalogMojo.java @@ -186,6 +186,11 @@ public void execute() throws MojoExecutionException, MojoFailureException { runtimeSpec.putMetadata("quarkus.native-builder-image", MavenSupport.getApplicationProperty(getClass(), "quarkus.native-builder-image")); + runtimeSpec.putMetadata("jib.maven-plugin.version", + MavenSupport.getApplicationProperty(getClass(), "jib.maven-plugin.version")); + runtimeSpec.putMetadata("jib.layer-filter-extension-maven.version", + MavenSupport.getApplicationProperty(getClass(), "jib.layer-filter-extension-maven.version")); + runtimeSpec.applicationClass("io.quarkus.bootstrap.runner.QuarkusEntryPoint"); runtimeSpec.addDependency("org.apache.camel.k", "camel-k-runtime"); diff --git a/support/camel-k-maven-plugin/src/main/resources/app.properties b/support/camel-k-maven-plugin/src/main/resources/app.properties index 9c5f2cb26..698b9ff53 100644 --- a/support/camel-k-maven-plugin/src/main/resources/app.properties +++ b/support/camel-k-maven-plugin/src/main/resources/app.properties @@ -16,3 +16,5 @@ ## --------------------------------------------------------------------------- quarkus.native-builder-image=${quarkus-native-builder-image} +jib.maven-plugin.version=${jib-maven-plugin-version} +jib.layer-filter-extension-maven.version=${jib-layer-filter-extension-maven-version}