Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-3506

karaf-maven-plugin doesn't handle leading whitespace on config file locations

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.0.M1
    • Fix Version/s: 3.0.4, 4.0.0.M3
    • Component/s: karaf
    • Labels:
      None

      Description

      Attempting to build custom karaf distributions using the karaf-maven-plugin to add features with config files with leading white space causes errors similar to the following:

      [WARNING] == Installing configuration file
      mvn:org.apache.karaf.cave/apache-karaf-cave/3.0.0/cfg/filesystem

      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 6.487s
      [INFO] Finished at: Fri Feb 06 17:13:52 CST 2015
      [INFO] Final Memory: 12M/170M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.0.M1:install-kars (default-install-kars) on project karaf-tooling-bug: Can not install cave-server feature: Illegal character in scheme name at index 0:
      [ERROR] mvn:org.apache.karaf.cave/apache-karaf-cave/3.0.0/cfg/filesystem

      In the above case, it appears that the source of the problem is that the configuration file location in apache-karaf-cave has a new line at the beginning of it that isn't handled correctly on line 537 of org.apache.karaf.tooling.features.InstallKarsMojo.java in the installConfigFile method:

      String configFileLocation = configFile.getLocation();

      updating that line to:

      String configFileLocation = configFile.getLocation().trim();

      resolves the problem.

        Attachments

        1. pom.xml
          1 kB
          Harry Smith

          Activity

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofré
              Reporter:
              infiniteuniverse Harry Smith
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: