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

while filtering resources the token replacement stops at the character @

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.5
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP, Java 1.6.0_16
    • Number of attachments :
      2

      Description

      Create a simple file hello.txt under src/main/resources with following content:
      "
      This property $

      {testProperty} was replaced
      but the one behind a @ will not be processed, as you
      see: ${testProperty}

      . You shouldn't see a property reference.
      "
      define a build section in your pom.xml like this
      <build>
      <resources>
      <resource>
      <directory>src/main/resources</directory>
      <filtering>true</filtering>
      <includes>
      <include>*/.txt</include>
      </includes>
      </resource>
      <resource>
      <directory>src/main/resources</directory>
      <filtering>false</filtering>
      <excludes>
      <exclude>*/.txt</exclude>
      </excludes>
      </resource>
      </resources>

      Run the command:

      mvn process-resources -DtestProperty=IwasReplaced

      this produces the output

      "
      This property IwasReplaced was replaced
      but the one behind a @ will not be processed, as you
      see: $

      {testProperty}

      . You shouldn't see a property reference.
      "

      As you see, the second property reference was not resolved. The replacement just stops after the @ character.

        Issue Links

          Activity

          Hide
          Stéphane Nicoll added a comment - - edited

          go, go, go Olivier

          Show
          Stéphane Nicoll added a comment - - edited go, go, go Olivier
          Hide
          Olivier Lamy added a comment -

          xmas gift
          BTW in fact we won't probably support anymore the multi line filtering

          Show
          Olivier Lamy added a comment - xmas gift BTW in fact we won't probably support anymore the multi line filtering
          Hide
          Olivier Lamy added a comment -

          fixed rev 1052028
          SNAPSHOT deployed.

          Show
          Olivier Lamy added a comment - fixed rev 1052028 SNAPSHOT deployed.
          Hide
          gotama added a comment -

          This is still broken in Maven 3.0.3 and maven-resources-plugin 2.5.

          The following is not resource filtered:

          <a href="mailto:email@address.com"><img src="$

          {content.url}

          /images/my.gif"/></a>

          Additionally, using the following work around breaks the pom.xml schema in violation of the required element outputDirectory:

          <configuration>
          <!--<outputDirectory>$

          {project.build.outputDirectory}

          </outputDirectory>-->
          <useDefaultDelimiters>false</useDefaultDelimiters>
          <delimiters>
          <delimiter>${*}</delimiter>
          </delimiters>
          </configuration>

          and, for some reason, uncommenting the above outputDirectory config to forcing defining the value to its default, breaks my hibernate unit tests for some reason due to malconfiguring the datasource.

          Show
          gotama added a comment - This is still broken in Maven 3.0.3 and maven-resources-plugin 2.5. The following is not resource filtered: <a href="mailto:email@address.com"><img src="$ {content.url} /images/my.gif"/></a> Additionally, using the following work around breaks the pom.xml schema in violation of the required element outputDirectory: <configuration> <!--<outputDirectory>$ {project.build.outputDirectory} </outputDirectory>--> <useDefaultDelimiters>false</useDefaultDelimiters> <delimiters> <delimiter>${*}</delimiter> </delimiters> </configuration> and, for some reason, uncommenting the above outputDirectory config to forcing defining the value to its default, breaks my hibernate unit tests for some reason due to malconfiguring the datasource.
          Hide
          Dennis Lundberg added a comment -

          gotama,

          Please open a new issue with a complete test project that we can use to verify your problem.

          Show
          Dennis Lundberg added a comment - gotama, Please open a new issue with a complete test project that we can use to verify your problem.

            People

            • Assignee:
              Olivier Lamy
              Reporter:
              Thomas Fahrmeyer
            • Votes:
              27 Vote for this issue
              Watchers:
              27 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: