Uploaded image for project: 'Maven Resources Plugin'
  1. Maven Resources Plugin
  2. MRESOURCES-81

2.3 escapes characters when filtering properties

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3
    • 2.4
    • None
    • None
    • Windows

    Description

      When filtering a property additional escaping characters are inserted into the replacement text. Here's an example pom snippett:

          <profiles>
              <profile>
                  <id>Automated-Testing-Windows</id>
                  <properties>
                      <server.resource.type>nt</server.resource.type>
                      <server.remote.base.dir>D:\\AutomatedTesting</server.remote.base.dir>
                      <server.remote.temp.dir>${server.remote.base.dir}\\temp</server.remote.temp.dir>
                  </properties>
              </profile>
        <build>
          <resources>
            <resource>
              <directory>src/main/resources/${server.resource.type}</directory>
              <filtering>true</filtering>
            </resource>
          </resources>
          <resources>
          <plugins>
            <plugin>
              <artifactId>maven-resources-plugin</artifactId>
              <version>2.3</version>
              <executions>
                <execution>
                  <id>resources</id>
                  <phase>process-resources</phase>
                  <goals>
                    <goal>resources</goal>
                  </goals>
                  <configuration>
                    <outputDirectory>${project.build.directory}/resources</outputDirectory>
                    <includeEmptyDirectories>true</includeEmptyDirectories>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </build>
      

      and the following line of text in a file in src\main\resources\nt
      cd /d ${server.remote.temp.dir}

      Resources plug in version 2.2 filters this property as follows:
      cd /d D:\\AutomatedTesting
      temp

      Resources plug in version 2.3 filters this property differently:
      cd /d D\:\\\\AutomatedTesting\\\\temp

      Notice the extra backslashes inserted before each backslash (minor issue) and colon (major issue). Is there a way to prevent maven from inserting these escape characters?

      I also checked out 2.4-SNAPSHOT revision 732027 and observed the same behavior.

      Thanks,
      -Paul

      Attachments

        Issue Links

          Activity

            People

              jdcasey John Dennis Casey
              paul_jackson Paul Jackson
              Votes:
              8 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: