squakez commented on code in PR #5198:
URL: https://github.com/apache/camel-k/pull/5198#discussion_r1508761743


##########
pkg/builder/quarkus.go:
##########
@@ -261,6 +201,39 @@ func BuildQuarkusRunnerCommon(ctx context.Context, mc 
maven.Context, project mav
        return nil
 }
 
+func computeApplicationProperties(appPropertiesPath string, 
applicationProperties map[string]string) error {
+       f, err := os.OpenFile(appPropertiesPath, os.O_RDWR|os.O_CREATE, 0666)
+       if err != nil {
+               return fmt.Errorf("failure while creating 
application.properties: %w", err)
+       }
+       if applicationProperties == nil {
+               // Default build time properties
+               applicationProperties = make(map[string]string)
+       }
+       // disable quarkus banner
+       applicationProperties["quarkus.banner.enabled"] = "false"
+       // required for to resolve data type transformers at runtime with 
service discovery
+       // the different Camel runtimes use different resource paths for the 
service lookup
+       
applicationProperties["quarkus.camel.service.discovery.include-patterns"] = 
"META-INF/services/org/apache/camel/datatype/converter/*,META-INF/services/org/apache/camel/datatype/transformer/*,META-INF/services/org/apache/camel/transformer/*"
+       // Workaround to prevent JS runtime errors, see 
https://github.com/apache/camel-quarkus/issues/5678
+       applicationProperties["quarkus.class-loading.parent-first-artifacts"] = 
"org.graalvm.regex:regex"
+       defer f.Close()
+       // Fill with properties coming from user configuration
+       for k, v := range applicationProperties {
+               if _, err := f.WriteString(fmt.Sprintf("%s=%s\n", k, v)); err 
!= nil {
+                       return err
+               }
+       }
+       if err := f.Sync(); err != nil {
+               return err
+       }
+       w := bufio.NewWriter(f)

Review Comment:
   Well spotted, thanks. It was a leftover.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to