@parameter using 'property' to allow custom naming convention, throws a NPE if 
the parameter is defined, but empty.
-------------------------------------------------------------------------------------------------------------------

                 Key: MNG-5097
                 URL: http://jira.codehaus.org/browse/MNG-5097
             Project: Maven 2 & 3
          Issue Type: Bug
          Components: Plugin API
    Affects Versions: 3.0.3
         Environment: Gentoo Linux, amd64, multicore.
            Reporter: rydnr
            Priority: Minor
         Attachments: build.log, empty-string-npe.zip

The test case (not JUnit) is attached.

If a Maven plugin runs within Maven 3.0.3, and defines

/**
 * @parameter property="abc"
 */
private String somethingDifferentThanAbc;

public void setAbc(String value) {
  somethingDifferentThanAbc = value;
}

Works for non-empty values:
<abc>abc-value</abc>

But throws a NPE in 
org.codehaus.plexus.component.configurator.converters.ComponentValueSetter:331 
(fieldTypeConverter is null) with empty values:

<abc></abc>

It works in Maven 2.x. It works if you declare the 
property with no naming conventions:

private String abc;

As a side note, the plexus classes being used are not the ones declared in the 
pom, but the ones bundled within $MAVEN_HOME/lib/sisu-inject-plexus-2.1.1.jar.

I couldn't find sisu-inject-plexus-2.1.1-sources.jar anywhere, but the 
repository itself is fortunately available at

https://github.com/sonatype/sisu.git

And then within

/sisu-inject/containers/guice-plexus/guice-plexus-shim/src/main/java/

I could have try to post a patch, but I'm not really sure about why this corner 
case is producing plexus-container's misbehavior.

-- 
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

        

Reply via email to