Claus Ibsen created CAMEL-24226:
-----------------------------------

             Summary: camel export - support --resource-dirs to copy 
directories into src/main/resources preserving structure
                 Key: CAMEL-24226
                 URL: https://issues.apache.org/jira/browse/CAMEL-24226
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang
            Reporter: Claus Ibsen


When performing a camel export, non-route files (like .xsd, .wsdl) are copied 
flat into src/main/resources, losing their directory structure.

For example, if you have:
{code}
./soap/file.xsd
{code}

It currently becomes:
{code}
src/main/resources/file.xsd
{code}

But the expected behavior would be:
{code}
src/main/resources/soap/file.xsd
{code}

This is a problem for SOAP/WSDL projects where schema files have relative 
imports between them that depend on directory structure.

h3. Proposed Feature

Add a {{--resource-dirs}} option to {{camel export}} that accepts one or more 
directories to recursively copy into {{src/main/resources}} while preserving 
the directory structure.

Example:
{code}
camel export --resource-dirs=./soap/
{code}

Would produce:
{code}
src/main/resources/soap/file.xsd
{code}

h3. Open Question: Relative Paths Outside Project Root

For paths that go outside the project root (e.g., 
{{--resource-dirs=../../mydata/foo}}), it is unclear what the target directory 
structure should be. A simple rule could be: use only the final directory name, 
so {{../../mydata/foo/}} copies into {{src/main/resources/foo/}}. But this 
needs further consideration.

h3. Technical Notes

The current implementation:
* {{Run.java}} classifies non-route files as classpath files 
({{camel.jbang.classpathFiles}})
* {{ExportBaseCommand.copySourceFiles()}} copies them flat using only the 
filename
* {{RunHelper.dirToFiles()}} only lists immediate children (non-recursive)

_Claude Code on behalf of davsclaus_



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

Reply via email to