Skip to content

Commit 7f8f38c

Browse files
committed
fix(trait): deprecate old native profile
Closes #6021
1 parent 3b7523a commit 7f8f38c

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

pkg/builder/runtime_support.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,14 @@ func (n *NativeSourcesAdapter) NativeMavenProperty() string {
5858
}
5959

6060
// NativeAdapter used for Camel Quarkus runtime < 3.5.0.
61+
// Deprecated: use NativeSourcesAdapter instead.
6162
type NativeAdapter struct {
6263
}
6364

6465
// BuildCommands -- .
6566
func (n *NativeAdapter) BuildCommands() string {
6667
// We must override the local repo as it's not shared from the builder container
67-
return "cd " + n.Directory() + " && ./mvnw $(cat MAVEN_CONTEXT) package -Dquarkus.native.enabled=true -Dmaven.repo.local=./repo"
68+
return "cd " + n.Directory() + " && ./mvnw $(cat MAVEN_CONTEXT) package -Dmaven.repo.local=./repo"
6869
}
6970

7071
// Directory -- .
@@ -79,17 +80,11 @@ func (n *NativeAdapter) TargetDirectory(ctxPath, runner string) string {
7980

8081
// NativeMavenProperty -- .
8182
func (n *NativeAdapter) NativeMavenProperty() string {
82-
// Empty on purpose. The parameter will be provided later by the command (see BuildCommands()).
83+
// Empty on purpose.
8384
return ""
8485
}
8586

8687
// QuarkusRuntimeSupport is used to get the proper native configuration based on the Camel Quarkus version.
8788
func QuarkusRuntimeSupport(version string) QuarkusRuntimeNativeAdapter {
88-
// Version 3.6.0 depends on a parameter which is available on JDK-21 based image.
89-
// For this reason we fallback to the "legacy" Quarkus native build.
90-
// Hopefully this will be solved starting from runtime version 3.7.0.
91-
if version < "3.7.0" {
92-
return &NativeAdapter{}
93-
}
9489
return &NativeSourcesAdapter{}
9590
}

pkg/trait/quarkus.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,13 +383,14 @@ func (t *quarkusTrait) applyWhenBuildSubmitted(e *Environment) error {
383383

384384
//nolint:nestif
385385
if native {
386+
buildTask.Maven.Properties["quarkus.native.enabled"] = "true"
386387
if nativePackageType := builder.QuarkusRuntimeSupport(e.CamelCatalog.GetCamelQuarkusVersion()).NativeMavenProperty(); nativePackageType != "" {
387388
buildTask.Maven.Properties[nativePackageType] = "true"
388-
if t.NativeBaseImage == "" {
389-
packageTask.BaseImage = QuarkusNativeDefaultBaseImageName
390-
} else {
391-
packageTask.BaseImage = t.NativeBaseImage
392-
}
389+
}
390+
if t.NativeBaseImage == "" {
391+
packageTask.BaseImage = QuarkusNativeDefaultBaseImageName
392+
} else {
393+
packageTask.BaseImage = t.NativeBaseImage
393394
}
394395
if len(e.IntegrationKit.Spec.Sources) > 0 {
395396
buildTask.Sources = e.IntegrationKit.Spec.Sources

0 commit comments

Comments
 (0)