Maven Resources Plugin
  1. Maven Resources Plugin
  2. MRESOURCES-111

escapeWindowsPath doesn't work when applying properties

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.1
    • Fix Version/s: 2.6
    • Component/s: None
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      The attached project contains a property file "src/test/main/hibernate.properties". I'd like to inject the projects build path into that file. More precisely, I have a property "jdbc.url" in my pom.xml, which looks like this:

      <jdbc.url>jdbc:derby:$

      {project.build.directory}

      /derby-db;create=true</jdbc.url>

      In hibernate.properties, I have

      hibernate.connection.url=$

      {jdbc.url}

      Which resolves to

      hibernate.connection.url=jdbc:derby:C:\workspace\mydemo\target/derby-db;create=true

      which is invalid, because the backslashes aren't escaped.

        Issue Links

          Activity

          Hide
          Jochen Wiedmann added a comment -

          Recommended workaround: Use property files in XML format and replace Properties.load with Properties.loadFromXML.

          See http://www.ibm.com/developerworks/java/library/j-tiger02254/index.html

          Show
          Jochen Wiedmann added a comment - Recommended workaround: Use property files in XML format and replace Properties.load with Properties.loadFromXML. See http://www.ibm.com/developerworks/java/library/j-tiger02254/index.html

            People

            • Assignee:
              Olivier Lamy
              Reporter:
              Jochen Wiedmann
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: