[ 
https://issues.apache.org/jira/browse/CAMEL-14350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Luca Burgazzoli updated CAMEL-14350:
------------------------------------
    Description: 
assuming that the xml-routes option on camel main is set to something like:

{code}
file:path/to/soures/camel-*.xml
{code}

then camel main is unable to locate the xml routes in the target path. 

The documentation states that "Files can be loaded from either classpath or 
file by prefixing with classpath: or file:" but looking at the code, seems that 
the DefaultPackageScanResourceResolver which is what DefaultRoutesCollector 
leverage under the hoods, takes into account class path only resources.

To reproduce it, add the following tests to MainXmlTest

{code:java}
@Test
public void testMainRoutesCollectorScanDir() throws Exception {
    doTestMain("file:src/test/resources/org/apache/camel/main/xml/camel-*.xml");
}

@Test
public void testMainRoutesCollectorScanClasspath() throws Exception {
    doTestMain("classpath:org/apache/camel/main/xml/camel-*.xml");
}
{code}




  was:
assuming that the xml-routes option on camel main is set to something like:

{code}
file:path/to/soures/camel-*.xml
{code}

then camel main is unable to locate the xml routes in the target path. 

The docuemntation states that "Files can be loaded from either classpath or 
file by prefixing with classpath: or file:" but looking at the code, seems that 
the DefaultPackageScanResourceResolver which is what DefaultRoutesCollector 
leverage under the hoods, takes into account class path only resources.

To reproduce it, add the following tests to MainXmlTest

{code:java}
@Test
public void testMainRoutesCollectorScanDir() throws Exception {
    doTestMain("file:src/test/resources/org/apache/camel/main/xml/camel-*.xml");
}

@Test
public void testMainRoutesCollectorScanClasspath() throws Exception {
    doTestMain("classpath:org/apache/camel/main/xml/camel-*.xml");
}
{code}





> camel-main: xml routes discovery does not work outside the classpath
> --------------------------------------------------------------------
>
>                 Key: CAMEL-14350
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14350
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core, camel-main
>    Affects Versions: 3.0.0
>            Reporter: Luca Burgazzoli
>            Priority: Major
>             Fix For: 3.0.1, 3.1.0
>
>
> assuming that the xml-routes option on camel main is set to something like:
> {code}
> file:path/to/soures/camel-*.xml
> {code}
> then camel main is unable to locate the xml routes in the target path. 
> The documentation states that "Files can be loaded from either classpath or 
> file by prefixing with classpath: or file:" but looking at the code, seems 
> that the DefaultPackageScanResourceResolver which is what 
> DefaultRoutesCollector leverage under the hoods, takes into account class 
> path only resources.
> To reproduce it, add the following tests to MainXmlTest
> {code:java}
> @Test
> public void testMainRoutesCollectorScanDir() throws Exception {
>     
> doTestMain("file:src/test/resources/org/apache/camel/main/xml/camel-*.xml");
> }
> @Test
> public void testMainRoutesCollectorScanClasspath() throws Exception {
>     doTestMain("classpath:org/apache/camel/main/xml/camel-*.xml");
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to