Claus Ibsen created CAMEL-25327:
-----------------------------------

             Summary: camel-jbang - the source validator finds the project's 
classes under src/main/java
                 Key: CAMEL-25327
                 URL: https://issues.apache.org/jira/browse/CAMEL-25327
             Project: Camel
          Issue Type: Bug
          Components: camel-jbang
            Reporter: Claus Ibsen


The source validator (camel_write_file, camel_validate_source, camel validate 
source) refuses a bean whose class is in the Maven layout of the project:

{code:yaml}
- beans:
  - name: orderNumber
    type: "#class:camel.example.OrderNumber"
{code}

with {{src/main/java/camel/example/OrderNumber.java}} in the project fails with 
"class camel.example.OrderNumber was not found (check the package name; a class 
of your own goes in a .java file next to the route; ...)", although {{camel run 
--source-dir}} compiles and runs that layout (verified: the route logs New 
order ORD-1001, ORD-1002).

Cause: {{SourceValidator.BeanDeclarations.scan}} lists only the files directly 
in the directory ({{Files.list}}), so the project's classes under src/main/java 
are not known.

Found in the local-model benchmark (round 4, run/order-generator step 2, failed 
3 of 3 early runs): the model put the class in the Maven layout, wrote a 
correct beans.yaml, was refused twice and gave up.

Fix: the scan also reads the .java files under src/main/java; the hint mentions 
src/main/java.



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

Reply via email to