From 8541979e47adcd1afd822bbd363f5724e55ffe4d Mon Sep 17 00:00:00 2001 From: Pasquale Congiusti Date: Thu, 19 Dec 2024 16:04:15 +0100 Subject: [PATCH] fix(trait): mount native plain Quarkus --- pkg/trait/mount.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pkg/trait/mount.go b/pkg/trait/mount.go index b1a3d3034e..e3a3c07445 100644 --- a/pkg/trait/mount.go +++ b/pkg/trait/mount.go @@ -439,15 +439,20 @@ func (t *mountTrait) addSourcesProperties(e *Environment) { if e.ApplicationProperties == nil { e.ApplicationProperties = make(map[string]string) } - isQuarkusNative := false - if qt := e.Catalog.GetTrait(quarkusTraitID); qt != nil { - if quarkus, ok := qt.(*quarkusTrait); ok && quarkus.isNativeIntegration(e) { - isQuarkusNative = true + if e.CamelCatalog.GetRuntimeProvider() == v1.RuntimeProviderPlainQuarkus { + sourceLocationEnabled := false + for _, s := range e.Integration.AllSources() { + // We don't process routes embedded (native) or Kamelets + if e.isEmbedded(s) || s.IsGeneratedFromKamelet() { + continue + } + sourceLocationEnabled = true + break + } + if sourceLocationEnabled { + e.ApplicationProperties["camel.main.source-location-enabled"] = boolean.TrueString + e.ApplicationProperties["camel.main.routes-include-pattern"] = fmt.Sprintf("file:%s/**", camel.SourcesMountPath) } - } - if e.CamelCatalog.GetRuntimeProvider() == v1.RuntimeProviderPlainQuarkus && !isQuarkusNative { - e.ApplicationProperties["camel.main.source-location-enabled"] = boolean.TrueString - e.ApplicationProperties["camel.main.routes-include-pattern"] = fmt.Sprintf("file:%s/**", camel.SourcesMountPath) } else { idx := 0 for _, s := range e.Integration.AllSources() {