Serdar Gökay created CAMEL-25186:
------------------------------------

             Summary: camel-jbang export - dependency of the delegate endpoint 
of a master: endpoint is not detected
                 Key: CAMEL-25186
                 URL: https://issues.apache.org/jira/browse/CAMEL-25186
             Project: Camel
          Issue Type: Bug
          Components: camel-jbang
    Affects Versions: 4.22.1
            Reporter: Serdar Gökay


{{camel export}} and {{camel dependency list}} do not detect the component used 
by the delegate URI of a {{master:}} endpoint.

During the silent export run, {{DependencyDownloaderComponentResolver}} 
(camel-kamelet-main) stubs every component outside {{ACCEPTED_STUB_NAMES}}, 
including {{master}}. The stubbed {{MasterEndpoint}} therefore never calls 
{{getEndpoint(delegateUri)}}, so the delegate's component is never resolved and 
its artifact is never recorded. The exported project builds but fails at 
startup. {{camel run}} works because nothing is stubbed.

*Reproducer*

route.camel.yaml:
{code:yaml}
- route:
    from:
      uri: master:lock:timer:tick
      steps:
        - log: "tick"
{code}

application.properties:
{code}
camel.cluster.file.enabled=true
camel.cluster.file.root=/tmp/master-repro
{code}

Steps:
# {{camel run route.camel.yaml application.properties}} - works, logs "tick".
# {{camel export route.camel.yaml application.properties --runtime=camel-main 
--gav=x:y:1.0 --dir=out}}
# {{cd out && ./mvnw package && java -jar target/y-1.0.jar}}

*Actual:* the pom contains camel-master but not camel-timer (same for {{camel 
dependency list}}). Startup fails with:
{noformat}
NoSuchEndpointException: No endpoint could be found for: timer://tick, please 
check your classpath contains the needed Camel component jar.
{noformat}
The same happens with {{uri: master:lock}} plus {{parameters: delegateUri: 
timer:tick}}.

*Expected:* export includes the delegate's component (camel-timer), as it does 
for a plain {{timer:tick}} route and as {{camel run}} resolves it.

Also reproduced from current main (4.23.0-SNAPSHOT). Related precedents for 
implied dependencies in the same resolver: CAMEL-21634 (cron -> quartz), 
CAMEL-24849.

*Workaround:* pass the delegate component explicitly, e.g. 
{{--dep=org.apache.camel:camel-timer}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to