davsclaus opened a new pull request, #29981: URL: https://github.com/apache/camel/pull/29981
Two points of item 7 of [CAMEL-26930](https://issues.apache.org/jira/browse/CAMEL-26930) that were found by reading the code: where camel run reads and writes files. ## The profile properties `RunProfileProperties.load` read `application.properties` from the folder of the files (or the source directory), but `application-<profile>.properties` from the current directory. So `camel run other/route.camel.yaml --profile=dev`, or a run of an example, took `application.properties` from there and the profile from here (and a profile file of the current directory into another project). It is now read next to `application.properties`, as `RunPipeline` already adds it to the files of the run. The golden case `profile` (`--profile=dev`, with `camel.jbang.dependencies` in both files) shows it: the test runs from the module folder, so the profile file was not found, and the export had the dependencies of both files. Run from inside the folder, the profile was read and its `camel.jbang.dependencies=camel:kafka` overrode `camel:http`, as it does now from anywhere: ``` -camel.jbang.dependencies=camel\:http,camel\:kafka -dependency=mvn\:org.apache.camel\:camel-http\:${camel.version} +camel.jbang.dependencies=camel\:kafka ``` ## The clipboard `camel run clipboard.java` with a Java class in the clipboard wrote `<Class>.java` into the current directory, over a file of that name; the other clipboard files go to the work directory (`.camel-jbang/work`). The class now goes there too, still under its class name, so it compiles. ## Tests - `RunProfilePropertiesTest` (new): the profile is read next to `application.properties` (it fails without the fix), and the profile of a source directory. - `RunClipboardFileTest` (new): a Java class is `<work>/<Class>.java`, without its package; other files are `<work>/generated-clipboard.<ext>`. - The golden `profile.export.txt`, as above. - camel-jbang-run: 321 pass. camel-jbang-core: 3071 + 264 pass. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
