[
https://issues.apache.org/jira/browse/CAMEL-19922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17771068#comment-17771068
]
Aurélien Pupier commented on CAMEL-19922:
-----------------------------------------
Unfortunately, no tonly a mater of using Java Properties API to write the file
because the file is read in different places. Sometimes with Java Properties
API and sometimes not.
To be investigated more but it sounds like the properties file generated can
have several times the same key, which is not a valid java properties file.
(this seems to be used to specify "dependency")
> Camel JBang dependency is not supporting absolute path on Windows
> -----------------------------------------------------------------
>
> Key: CAMEL-19922
> URL: https://issues.apache.org/jira/browse/CAMEL-19922
> Project: Camel
> Issue Type: Bug
> Components: camel-jbang
> Affects Versions: 4.0.1
> Reporter: Aurélien Pupier
> Assignee: Aurélien Pupier
> Priority: Minor
>
> {noformat}
> jbang camel@apache/camel dependency copy
> --output-directory="c:\Users\Aurelien
> Pupier\AppData\Roaming\Code\User\globalStorage\redhat.vscode-camelk\java-dependencies"
> "c:\git\vscode-camelk\test Fixture with speci@l
> chars\MyValidRouteBuilder.java"
> {noformat}
> gives error:
> {noformat}
> java.nio.file.InvalidPathException: Illegal char < > at index 18:
> c:gitvscode-camelk est Fixture with speci@l
> charsMyValidRouteBuilder.java
> at
> java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
> at
> java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
> at
> java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
> at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
> at
> java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
> at java.base/java.io.File.toPath(File.java:2387)
> at
> org.apache.camel.dsl.jbang.core.commands.ExportBaseCommand.copySourceFiles(ExportBaseCommand.java:458)
> at
> org.apache.camel.dsl.jbang.core.commands.ExportCamelMain.copySourceFiles(ExportCamelMain.java:337)
> at
> org.apache.camel.dsl.jbang.core.commands.ExportCamelMain.export(ExportCamelMain.java:102)
> at
> org.apache.camel.dsl.jbang.core.commands.Export.export(Export.java:130)
> at
> org.apache.camel.dsl.jbang.core.commands.DependencyCopy.doExport(DependencyCopy.java:115)
> at
> org.apache.camel.dsl.jbang.core.commands.DependencyCopy.export(DependencyCopy.java:51)
> at
> org.apache.camel.dsl.jbang.core.commands.ExportBaseCommand.doCall(ExportBaseCommand.java:215)
> at
> org.apache.camel.dsl.jbang.core.commands.Export.doCall(Export.java:28)
> at
> org.apache.camel.dsl.jbang.core.commands.DependencyCopy.doCall(DependencyCopy.java:46)
> 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:36)
> at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
> at picocli.CommandLine.access$1500(CommandLine.java:148)
> at
> picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
> at
> picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
> at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
> at picocli.CommandLine.execute(CommandLine.java:2170)
> at
> org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:159)
> at main.CamelJBang.main(CamelJBang.java:36)
> {noformat}
> potential workarounds for this part (even if still failing due to this other
> problem [CAMEL-19923]):
> - use forward slash:
> {noformat}
> jbang camel@apache/camel dependency copy
> --output-directory="c:\Users\Aurelien
> Pupier\AppData\Roaming\Code\User\globalStorage\redhat.vscode-camelk\java-dependencies"
> "c:/git/vscode-camelk/test Fixture with speci@l
> chars/MyRouteBuilderWithAdditionalDependencies.java"
> {noformat}
> - escape backslash:
> {noformat}
> jbang camel@apache/camel dependency copy
> --output-directory="c:\Users\Aurelien
> Pupier\AppData\Roaming\Code\User\globalStorage\redhat.vscode-camelk\java-dependencies"
> "c:\\git\\vscode-camelk\\test Fixture with speci@l
> chars\\MyValidRouteBuilder.java"
> {noformat}
> note: the run is working fine with absolute path using the Windows path
> it was working fine with kamel local for which Camel jbang copy dependency is
> the replacement.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)