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

   ## Summary
   
   _Claude Code on behalf of @${OPERATOR}_
   
   When upgrading the Camel CLI, the old `~/.camel-jbang-plugins.json` file may 
still list plugins that are now bundled as embedded plugins. This causes 
picocli to throw a `DuplicateNameException` because the same subcommand name 
gets registered twice.
   
   This fix makes `PluginHelper` guard against duplicate registrations in both 
plugin loading paths:
   - **JSON config path**: the existing `containsKey` guard was conditional on 
`foundEmbeddedPlugins` — now it fires unconditionally so stale JSON entries are 
always skipped
   - **Embedded plugin path**: added a `containsKey` guard before 
`plugin.customize()` in `loadPluginFromService()`
   
   Both guards protect all plugins generically.
   
   ## Test plan
   
   - [x] Verified the module compiles cleanly
   - [ ] Manual test: install Camel CLI 4.22, add a stale `tui` entry to 
`~/.camel-jbang-plugins.json`, run `camel --version` — should work without 
`DuplicateNameException`
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   Co-Authored-By: Claude Opus 4.6 <[email protected]>


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