This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push: new 34d8de6dc fix(trait): deprecate old native profile 34d8de6dc is described below commit 34d8de6dc6893bb0428352340ae65c3965e7df7a Author: Pasquale Congiusti <pasquale.congiu...@gmail.com> AuthorDate: Thu Jan 16 18:13:14 2025 +0100 fix(trait): deprecate old native profile Closes #6021 --- pkg/builder/runtime_support.go | 11 +++-------- pkg/trait/jvm.go | 2 +- pkg/trait/quarkus.go | 11 ++++++----- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/pkg/builder/runtime_support.go b/pkg/builder/runtime_support.go index b65b2a9ab..d44be5be6 100644 --- a/pkg/builder/runtime_support.go +++ b/pkg/builder/runtime_support.go @@ -58,13 +58,14 @@ func (n *NativeSourcesAdapter) NativeMavenProperty() string { } // NativeAdapter used for Camel Quarkus runtime < 3.5.0. +// Deprecated: use NativeSourcesAdapter instead. type NativeAdapter struct { } // BuildCommands -- . func (n *NativeAdapter) BuildCommands() string { // We must override the local repo as it's not shared from the builder container - return "cd " + n.Directory() + " && ./mvnw $(cat MAVEN_CONTEXT) package -Dquarkus.native.enabled=true -Dmaven.repo.local=./repo" + return "cd " + n.Directory() + " && ./mvnw $(cat MAVEN_CONTEXT) package -Dmaven.repo.local=./repo" } // Directory -- . @@ -79,17 +80,11 @@ func (n *NativeAdapter) TargetDirectory(ctxPath, runner string) string { // NativeMavenProperty -- . func (n *NativeAdapter) NativeMavenProperty() string { - // Empty on purpose. The parameter will be provided later by the command (see BuildCommands()). + // Empty on purpose. return "" } // QuarkusRuntimeSupport is used to get the proper native configuration based on the Camel Quarkus version. func QuarkusRuntimeSupport(version string) QuarkusRuntimeNativeAdapter { - // Version 3.6.0 depends on a parameter which is available on JDK-21 based image. - // For this reason we fallback to the "legacy" Quarkus native build. - // Hopefully this will be solved starting from runtime version 3.7.0. - if version < "3.7.0" { - return &NativeAdapter{} - } return &NativeSourcesAdapter{} } diff --git a/pkg/trait/jvm.go b/pkg/trait/jvm.go index fc04dd5eb..f0e0a65da 100644 --- a/pkg/trait/jvm.go +++ b/pkg/trait/jvm.go @@ -225,7 +225,7 @@ func (t *jvmTrait) enableDebug(e *Environment) string { if meta.Labels == nil { meta.Labels = make(map[string]string) } - meta.Labels["camel.apache.org/debug"] = "true" + meta.Labels["camel.apache.org/debug"] = trueString }) t.DebugAddress = "*:5005" diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go index 323555074..d210eacdd 100644 --- a/pkg/trait/quarkus.go +++ b/pkg/trait/quarkus.go @@ -383,13 +383,14 @@ func (t *quarkusTrait) applyWhenBuildSubmitted(e *Environment) error { //nolint:nestif if native { + buildTask.Maven.Properties["quarkus.native.enabled"] = "true" if nativePackageType := builder.QuarkusRuntimeSupport(e.CamelCatalog.GetCamelQuarkusVersion()).NativeMavenProperty(); nativePackageType != "" { buildTask.Maven.Properties[nativePackageType] = "true" - if t.NativeBaseImage == "" { - packageTask.BaseImage = QuarkusNativeDefaultBaseImageName - } else { - packageTask.BaseImage = t.NativeBaseImage - } + } + if t.NativeBaseImage == "" { + packageTask.BaseImage = QuarkusNativeDefaultBaseImageName + } else { + packageTask.BaseImage = t.NativeBaseImage } if len(e.IntegrationKit.Spec.Sources) > 0 { buildTask.Sources = e.IntegrationKit.Spec.Sources