You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2025/07/14 15:21:00 UTC
[jira] [Commented] (CAMEL-22237) camel-jbang - Loading expression scripts from file vs classpath
[ https://issues.apache.org/jira/browse/CAMEL-22237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18005169#comment-18005169 ]
Claus Ibsen commented on CAMEL-22237:
-------------------------------------
We can make camel-jbang able to understand that if there is no classpath (default) then also look in current folder for the file (as then its root classpath)
> camel-jbang - Loading expression scripts from file vs classpath
> ---------------------------------------------------------------
>
> Key: CAMEL-22237
> URL: https://issues.apache.org/jira/browse/CAMEL-22237
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.14.0
>
>
> When you develop with camel-jbang and you externalize scripts into files, then you need to refer to these scripts wtih file: but if you export then you want this to be in classpath:
> {code:java}
> - setVariable:
> name: level
> expression:
> groovy:
> expression: resource:Gold.groovy
> {code}
>
> vs
> {code:java}
> - setVariable:
> name: level
> expression:
> groovy:
> expression: resource:file:Gold.groovy
> {code}
>
>
> Caused by: java.io.FileNotFoundException: Cannot find resource: Gold.groovy for URI: Gold.groovy
> at org.apache.camel.support.ResourceHelper.resolveMandatoryResourceAsInputStream(ResourceHelper.java:114)
> at org.apache.camel.support.LanguageSupport.loadResource(LanguageSupport.java:74)
> ... 38 more
--
This message was sent by Atlassian Jira
(v8.20.10#820010)