You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/11/23 13:41:10 UTC

[camel] branch main updated: camel-jbang - Auto-configure via java source should automatic download camel-joor if needed.

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 3c8d1c28d40 camel-jbang - Auto-configure via java source should automatic download camel-joor if needed.
3c8d1c28d40 is described below

commit 3c8d1c28d40b02d7f805520117f804e44958376e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Nov 23 14:40:45 2022 +0100

    camel-jbang - Auto-configure via java source should automatic download camel-joor if needed.
---
 .../org/apache/camel/main/download/AutoConfigureDownloadListener.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/AutoConfigureDownloadListener.java b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/AutoConfigureDownloadListener.java
index c661cfd92af..61df86092b3 100644
--- a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/AutoConfigureDownloadListener.java
+++ b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/AutoConfigureDownloadListener.java
@@ -95,6 +95,10 @@ public class AutoConfigureDownloadListener implements DownloadListener, CamelCon
         InputStream is = getClass().getResourceAsStream("/auto-configure/" + artifactId + ".joor");
         if (is != null) {
             try {
+                // ensure java-joor is downloaded
+                DependencyDownloader downloader = getCamelContext().hasService(DependencyDownloader.class);
+                // these are extra dependencies used in special use-case so download as hidden
+                downloader.downloadHiddenDependency("org.apache.camel", "camel-joor", camelContext.getVersion());
                 // execute script via java-joor
                 String script = IOHelper.loadText(is);
                 Language lan = camelContext.resolveLanguage("joor");