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

   ## Summary
   
   Item 7 of [CAMEL-26912](https://issues.apache.org/jira/browse/CAMEL-26912): 
**every export downloaded and loaded the Kamelets catalog, also for an 
integration that uses no Kamelets.**
   
   The export loaded the names of the official Kamelets 
(`KameletCatalogHelper.findKameletNames`) before it looked at the run settings, 
to tell whether a `kamelet=` line of the run is an official Kamelet. Loading 
the catalog downloads `camel-kamelets-catalog` with its dependencies (38 MB of 
the 53 MB of a first export with an empty Maven repository: 15.2s instead of 
1.5s), with a downloader of its own that does not use `--maven-settings` or its 
mirrors. Offline, or when the catalog cannot be downloaded, the export of a 
route without Kamelets failed.
   
   ### Fix
   
   The catalog is loaded at the first `kamelet=` line of the run settings, so 
only for an integration that uses Kamelets. The project is the same as before: 
without such a line, the export did not use the names of the catalog.
   
   With the unpacked launcher, a route without Kamelets and 
`--kamelets-version=0.0.0-no-such-version` (a catalog that cannot be loaded):
   
   | | before | after |
   |---|---|---|
   | exit | 70, `ClassNotFoundException: 
org.apache.camel.kamelets.catalog.KameletsCatalog` | 0, "Project export 
successful!" |
   | time | 6s | 2s |
   
   The downloader of the catalog not using `--maven-settings` is left as it is: 
it matters only for an integration with Kamelets now.
   
   ## Tests
   
   - 
`ProjectExporterTest.doesNotLoadTheKameletCatalogForAnIntegrationWithoutKamelets`:
 the export of a route with a catalog version that cannot be loaded succeeds, 
offline. It fails without the fix (`ClassNotFoundException`).
   - camel-jbang-run (271 tests), camel-jbang-core including 
`RunExportGoldenTest` and the Kamelet export tests (golden files unchanged), 
and camel-jbang-plugin-kubernetes (156 tests) pass locally. 
`QuarkusPlatformLookupTest` failed once with `./application.properties` not 
found and passed on the rerun: the tests share the current directory; it is not 
about Kamelets.
   
   _Claude Code on behalf of Claus Ibsen (davsclaus)_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS
   


-- 
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