[ 
https://issues.apache.org/jira/browse/CAMEL-21442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17898163#comment-17898163
 ] 

Aurélien Pupier edited comment on CAMEL-21442 at 11/14/24 7:50 AM:
-------------------------------------------------------------------

About kamelet-dir, hitting same kind of problem that the project structure 
needs to be reinvented. Usually users are creating kamelet at the same level 
than Camel routes. Also the Camel Jbang init is not giving any guidance and by 
default creating at the same level. So providing --kamelet-dir to current dir 
is the way to have it working by default.

using `jbang '-Dcamel.jbang.version=4.8.1' camel@apache/camel run 
test-with-xsl.camel.yaml --dev --logging-level=info --local-kamelet-dir=. 
*.xsl` is giving the same result. The *.xsl is used to select additional files 
to add the classpath, not to select files to run.

Added the project after the 3 steps  [^example-test-with-xsl-before-export.zip] 
:
* jbang '-Dcamel.jbang.version=4.8.1' camel@apache/camel init 
'test-with-xsl.camel.yaml'
* create an empty dummy.xsl file
* jbang '-Dcamel.jbang.version=4.8.1' camel@apache/camel run 
test-with-xsl.camel.yaml --dev --logging-level=info --local-kamelet-dir=. *.xsl


was (Author: apupier):
About kamelet-dir, hitting same kind of problem that the project structure 
needs to be reinvented. Usually users are creating kamelet at the same level 
than Camel routes. Also the Camel Jbang init is not giving any guidance and by 
default creating at the same level. So providing --kamelet-dir to current dir 
is the way to have it working by default.

using `jbang '-Dcamel.jbang.version=4.8.1' camel@apache/camel run 
test-with-xsl.camel.yaml --dev --logging-level=info --local-kamelet-dir=. 
*.xsl` is giving the same result. The *.xsl is used to select additional files 
to add the classpath, not to select files to run.

Added the project after the 3 steps:
* jbang '-Dcamel.jbang.version=4.8.1' camel@apache/camel init 
'test-with-xsl.camel.yaml'
* create an empty dummy.xsl file
* jbang '-Dcamel.jbang.version=4.8.1' camel@apache/camel run 
test-with-xsl.camel.yaml --dev --logging-level=info --local-kamelet-dir=. *.xsl

> camel-jbang - export is no more working when a previous run with an xsl file 
> on the classpath occured
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-21442
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21442
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jbang
>    Affects Versions: 4.8.1
>            Reporter: Aurélien Pupier
>            Priority: Minor
>         Attachments: example-test-with-xsl-before-export.zip
>
>
> it is a regression introduced in Camel 4.8.1, it is working fine with Camel 
> 4.8.0
> * jbang '-Dcamel.jbang.version=4.8.1' camel@apache/camel init 
> 'test-with-xsl.camel.yaml'
> * create an empty dummy.xsl file
> * jbang '-Dcamel.jbang.version=4.8.1' camel@apache/camel run 
> test-with-xsl.camel.yaml --dev --logging-level=info --local-kamelet-dir=. 
> *.xsl
> * jbang '-Dcamel.jbang.version=4.8.1' camel@apache/camel export 
> --runtime=quarkus --gav=com.acme:myproject:1.0-SNAPSHOT
> {noformat}
> Reusing existing run data
> Exporting as Quarkus project to: .
> java.nio.file.NoSuchFileException: 
> .camel-jbang/work/src/main/resources/kamelets/test-with-xsl.camel.yaml
>         at 
> java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
>         at 
> java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
>         at 
> java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
>         at 
> java.base/sun.nio.fs.UnixFileSystem.copyFile(UnixFileSystem.java:668)
>         at java.base/sun.nio.fs.UnixFileSystem.copy(UnixFileSystem.java:1060)
>         at 
> java.base/sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:300)
>         at java.base/java.nio.file.Files.copy(Files.java:1304)
>         at 
> org.apache.camel.dsl.jbang.core.commands.ExportBaseCommand.safeCopy(ExportBaseCommand.java:911)
>         at 
> org.apache.camel.dsl.jbang.core.commands.ExportBaseCommand.safeCopy(ExportBaseCommand.java:888)
>         at 
> org.apache.camel.dsl.jbang.core.commands.ExportBaseCommand.copySourceFiles(ExportBaseCommand.java:581)
>         at 
> org.apache.camel.dsl.jbang.core.commands.ExportQuarkus.export(ExportQuarkus.java:105)
>         at 
> org.apache.camel.dsl.jbang.core.commands.Export.export(Export.java:150)
>         at 
> org.apache.camel.dsl.jbang.core.commands.Export.export(Export.java:63)
>         at 
> org.apache.camel.dsl.jbang.core.commands.ExportBaseCommand.doCall(ExportBaseCommand.java:248)
>         at 
> org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:71)
>         at 
> org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:37)
>         at picocli.CommandLine.executeUserObject(CommandLine.java:2045)
>         at picocli.CommandLine.access$1500(CommandLine.java:148)
>         at 
> picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
>         at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
>         at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
>         at 
> picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
>         at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
>         at picocli.CommandLine.execute(CommandLine.java:2174)
>         at 
> org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:173)
>         at 
> org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:62)
>         at main.CamelJBang.main(CamelJBang.java:36)
> {noformat}
> Using jbang '-Dcamel.jbang.version=4.8.0' camel@apache/camel export 
> --runtime=quarkus --gav=com.acme:myproject:1.0-SNAPSHOT is exporting 
> successfully and then calling mvn quarkus:dev is working fine



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to