davsclaus commented on PR #26678:
URL: https://github.com/apache/camel/pull/26678#issuecomment-5764099152

   Thanks, addressed in the follow-up commit:
   
   1. **Exported projects** — confirmed from the code: 
`AnnotationDependencyInjection` (wired from `KameletMain`) is the only place a 
`CompilePostProcessor` is registered, so after `camel export` the `.groovy` 
file is compiled by `camel-main` but the `@BindToRegistry` class is not bound. 
Added a note to the "Custom functions in Groovy with Camel CLI" section 
(simple-advanced) and to "Using Groovy source files" (camel-jbang-beans): the 
binding is done by the Camel CLI, and an exported project should use the inline 
YAML `scriptLanguage: groovy` bean (created by `BeanModelHelper` in camel-core, 
so it works in every runtime) or a Java class. Making camel-main bind annotated 
Groovy classes is a feature on its own: 
[CAMEL-24879](https://issues.apache.org/jira/browse/CAMEL-24879).
   
   2. **`Run.java` dedupe** — the check now matches 
`startsWith("camel:groovy")` (covers `camel:groovy:x.y.z`) and 
`contains(":camel-groovy")` (covers `mvn:org.apache.camel:camel-groovy:x.y.z`). 
The profile-properties ordering is left as is: the check would have to move 
below the 
`addDependencies(RuntimeUtil.getDependenciesAsArray(profileProperties))` call, 
which restructures the method for a duplicate that is harmless, and the sibling 
auto-adds (`camel:jfr`, `camel:platform-http-main`, ...) do not dedupe against 
the profile either.
   
   3. **Instantiation policy** — deliberate, and left as is. The Groovy source 
support is documented as being for small functions and DTOs, and creating an 
instance of every compiled class would run the constructor of each DTO for 
nothing on every dev-mode reload. A Groovy `EventNotifier` gets picked up by 
giving it `@BindToRegistry`, like any other bean. Noted as a known asymmetry 
with `JavaRoutesBuilderLoader`.
   
   4. **Upgrade guide nit** — dropped the dev-profile paragraph from the 
camel-jbang section; it is a bug fix, not a migration item. The camel-groovy 
entry (annotated classes are now instantiated) and the `camel run` 
auto-dependency entry (changes what `camel export` emits) stay.
   
   _Claude Code on behalf of davsclaus_


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