Claus Ibsen created CAMEL-26855:
-----------------------------------

             Summary: camel-jbang - embedded plugins not found when the CLI is 
installed in a folder with a space, and a test that never runs
                 Key: CAMEL-26855
                 URL: https://issues.apache.org/jira/browse/CAMEL-26855
             Project: Camel
          Issue Type: Bug
          Components: camel-jbang
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 4.24.0


Two small camel-jbang bugs, found by the review of PR #29621 (CAMEL-23810):

h3. 1. The embedded plugins are not found when the CLI is installed in a folder 
with a space

{{PluginHelper.addEmbeddedPlugins}} scans the jar of the Camel CLI for the 
plugins it embeds. {{scanJarForPlugins}} turns the {{jar:file:...!/}} URL of 
that jar into a file name with {{URL.getPath()}}, which keeps the URL encoding: 
a space is {{%20}}. When the CLI is installed in a folder whose path has a 
space (such as {{C:\Program Files\...}} on Windows, or a home folder with a 
space), {{new JarFile(...)}} fails with a {{FileNotFoundException}}, the 
exception is ignored, and the embedded plugins are not found.

Fix: the jar file from the URL ({{JarURLConnection.getJarFileURL()}}) as a 
{{Path}} via its URI.

h3. 2. ExportMainApplicationProperties never runs

The test class does not end with {{Test}}, so surefire does not run it, and it 
is broken: it sets the files of the export with a fixed-size {{Arrays.asList}}, 
to which the export adds the {{application.properties}} it finds 
({{UnsupportedOperationException}}).

Fix: rename it to {{ExportMainApplicationPropertiesTest}} and give the command 
a list it can add to.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to