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

Custom Delimiters does not work as expected - NPE with ${*} and comments in property file does break replacement

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4
    • 2.4.1
    • None
    • None
    • Ubuntu Jaunty, Sun JDK 1.6.0_16, Maven 2.2.1

    Description

      Hi,

      using custom delimiters, stuff is not working as expected.

      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-resources-plugin</artifactId>
      <version>2.4</version>
      <configuration>
      <useDefaultDelimiters>false</useDefaultDelimiters>
      <delimiters>
      <delimiter>$</delimiter>
      <delimiter>@</delimiter>
      <delimiter>#</delimiter>
      <delimiter>${*}</delimiter>
      </delimiters>
      <encoding>UTF-8</encoding>
      </configuration>
      </plugin>

      mvn clean resources:resources does result in a NPE:

      java.lang.NullPointerException
      at org.codehaus.plexus.interpolation.multi.DelimiterSpecification.parse(DelimiterSpecification.java:54)
      at org.codehaus.plexus.interpolation.multi.MultiDelimiterStringSearchInterpolator.setDelimiterSpecs(MultiDelimiterStringSearchInterpolator.java:394)
      ....

      Removing the ${*} it runs.
      However it breaks if "comments" are there in the property file. Using the defaultDelimiters this is no problem.
      Additionally its not possible to use the default ones and specify additional ones (maybe its a side effect and should work, don't know).

      The "$" gets ignored if i use <useDefaultDelimiters>true</useDefaultDelimiters> and <delimiter>$</delimiter> .

      Look at the attached project for an non working example. ${*} is commented in the pom, use it to get the NPE.
      Removing the first comment line from the property file does result in a successfull replacement (but comments are ok there so it should run with it too) - let the comment there and it does only replace the first occurence of the property.

      Attachments

        1. test.tar.bz2
          0.9 kB
          Torsten Krah

        Issue Links

          Activity

            People

              olamy Olivier Lamy
              tkrah Torsten Krah
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: