Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18642

camel-jbang change class packag when export

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Information Provided
    • 3.18.2
    • 3.18.4, 3.20.0
    • camel-jbang
    • None
    • Unknown

    Description

      camel-jbang export change class package to group from gav.
      after that class reference in yaml is not correct anymore, ex:

      The following 2 files run using camel-jbang without any issues

      import org.apache.camel.BindToRegistry;
      import org.apache.camel.Exchange;
      import org.apache.camel.Processor;
      
      @BindToRegistry("CustomProcessor")
      public class CustomProcessor implements Processor {
      
        public void process(Exchange exchange) throws Exception {
            exchange.getIn().setBody("Hello world");
        }
      }
      

      and

      - route:
          from:
            uri: kamelet:timer-source
            steps:
              - process:
                  ref: '#CustomProcessor'
              - log:
                  message: ${body}
            parameters:
              period: 2000
              message: xxx
      

      while during export camel-jbang adds package to the class

      package org.test.demo;
      
      import org.apache.camel.BindToRegistry;
      import org.apache.camel.Exchange;
      import org.apache.camel.Processor;
      
      @BindToRegistry("CustomProcessor")
      public class CustomProcessor implements Processor {
      
        public void process(Exchange exchange) throws Exception {
            exchange.getIn().setBody("Hello world");
        }
      }
      

      After that yaml ref is not correct anymore
      We need to find a way to make export without changing source files

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            marat.gubaidullin@gmail.com Marat Gubaidullin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: