[ http://jira.codehaus.org/browse/MRESOURCES-105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=192590#action_192590 ]
John Casey commented on MRESOURCES-105: --------------------------------------- part of the problem with the NPE seems to be related to the way the PluginParameterExpressionEvaluator resolves plugin configuration in Maven. It seems that it will happily replace '${*}' with null as it processes a list of configuration values (so it's actually probably a problem in plexus-container-default, since that's where the expression-evaluator will inevitably hand off the value, I'm guessing). I had to compensate for this in the remote-resources plugin by catching a null delimiter value and re-inserting '${*}' (I found it here after I'd already released the resources plugin). I don't think this will have serious side effects other than to say that using a custom delimiter such as '${filtered:*}' will result in '${*}' being passed in...again, this compensation has only happened in the remote resources plugin. Without fixing maven itself, and probably plexus itself, I'm not sure how to do better. > Custom Delimiters does not work as expected - NPE with ${*} and comments in > property file does break replacement > ---------------------------------------------------------------------------------------------------------------- > > Key: MRESOURCES-105 > URL: http://jira.codehaus.org/browse/MRESOURCES-105 > Project: Maven 2.x Resources Plugin > Issue Type: Bug > Affects Versions: 2.4 > Environment: Ubuntu Jaunty, Sun JDK 1.6.0_16, Maven 2.2.1 > Reporter: Torsten Krah > Assignee: Olivier Lamy > Attachments: test.tar.bz2 > > > 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. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira