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

   ## Description
   
   `camel export` copies every `.groovy` file into 
`src/main/resources/camel-groovy`, the directory 
`camel.main.groovyScriptPattern` compiles scripts from at startup. A Groovy 
mapping script that a route uses as the body of an expression, `groovy: 
{expression: "resource:classpath:shipment-mapping.groovy"}`, is then out of 
reach of the reference in the exported project (it would have to read 
`camel-groovy/shipment-mapping.groovy`), and is compiled as a script it is not. 
Neither `resource:classpath:` nor `resource:file:` by bare name survived the 
export; with CAMEL-24852 the `classpath:` form works in `camel run` too, so it 
is the form to write in both places.
   
   The export now scans the route files (`camel.main.routesIncludePattern`) for 
`resource:classpath:x` / `resource:file:x` references and keeps a referenced 
Groovy file at the resources root, where the reference resolves on Spring Boot, 
Quarkus and camel-main alike. Groovy files the routes do not reference go to 
`camel-groovy` as before. Upgrade guide note added.
   
   The camel-jbang-examples data-mapping example is the case (it uses 
`resource:file:`; a follow-up there switches it to `classpath:`).
   
   ## Tests
   
   `ExportTest.shouldExportAResourceReferencedGroovyScriptToTheResourcesRoot` 
(all three runtimes): a route referencing `shipment-mapping.groovy` as a 
resource plus an unreferenced `demo.groovy`: the first lands at 
`src/main/resources/`, the second in `camel-groovy/`. The existing 
`shouldExportGroovy` keeps passing.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj


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