davsclaus opened a new pull request, #26665: URL: https://github.com/apache/camel/pull/26665
Fixes https://issues.apache.org/jira/browse/CAMEL-24865 Under `camel run --source-dir` the resource loader replaced every `classpath:` or `file:` resource that was not found with `file:<source-dir>/<path>`, whether or not that file existed. A resource that was optional (`?optional=true`) then stopped being optional: `JavaLanguage` could not initialise (`classpath:camel-joor.properties?optional=true` became a file that did not exist), so the `spring.datasource.url` auto-configure recipe never ran and any sql route failed with `Property 'dataSource' is required`. The same app started with `camel run sql.camel.yaml application.properties` worked. With this change the source-dir branch only replaces the answer when the file exists, like the fallback-dirs branch already did; a resource that exists nowhere keeps its original answer so errors name the location as written. Test: `DependencyDownloaderResourceLoaderTest.aMissingResourceUnderSourceDirIsStillMissing`. Verified by hand with an H2 datasource app under `--source-dir`: the datasource is configured and the table is created. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj -- 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]
