davsclaus opened a new pull request, #26574:
URL: https://github.com/apache/camel/pull/26574

   A bean declared in YAML with a class that is not on the CLI classpath, such 
as `#class:org.postgresql.ds.PGSimpleDataSource` or the Artemis 
`ActiveMQConnectionFactory`, was reported by `camel validate` and the write 
tool as "class ... was not found", while `camel run` resolves exactly these 
classes through `camel-main-known-dependencies.properties`, downloads the jar 
and starts the route. The validator contradicted the runtime.
   
   The check now loads the same two mapping files camel-kamelet-main uses 
(`camel-main-known-dependencies.properties`, 
`camel-component-known-dependencies.properties`) and matches the class name and 
then each enclosing package, as `KnownDependenciesResolver.findGav` does; a 
mapped class is not an error. For a class in no mapping the message says how to 
declare the dependency:
   
   ```
   class com.zaxxer.hikari.HikariDataSourceX was not found (check the package 
name; a class of your own goes in a .java file next to the route; a class from 
another library needs its dependency declared, 
camel.jbang.dependencies=<groupId>:<artifactId>:<version> in 
application.properties or --dep on camel run)
   ```
   
   Two tests: the Postgres datasource and the Artemis connection factory pass 
without a dependency declared; a class from an unknown library gets the 
declaration hint. camel-jbang-core already depends on camel-kamelet-main, so 
the mapping files are on the classpath.
   
   🤖 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]

Reply via email to