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

camel-main: xml routes discovery does not work outside the classpath

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.1, 3.1.0
    • camel-core, camel-main
    • None
    • Unknown

    Description

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

      file:path/to/soures/camel-*.xml
      

      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

      @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");
      }
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            lb Luca Burgazzoli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment