Specifying an unset property in <properties> causes a NullPointerException
--------------------------------------------------------------------------

                 Key: MINVOKER-118
                 URL: https://jira.codehaus.org/browse/MINVOKER-118
             Project: Maven 2.x Invoker Plugin
          Issue Type: Bug
    Affects Versions: 1.6
         Environment: Maven 3.0.2
            Reporter: Derek Lewis
         Attachments: maven-invoker-plugin-bug.zip

When the invoker plugin is configured with a property as follows:
<properties>
        <some.property>${example.property}</some.property>
</properties>

If example.property is not set, the plugin throws a NullPointerException:
Caused by: java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:394)
        at java.util.Hashtable.putAll(Hashtable.java:466)
        at 
org.apache.maven.plugin.invoker.AbstractInvokerMojo.getSystemProperties(AbstractInvokerMojo.java:1413)
        at 
org.apache.maven.plugin.invoker.AbstractInvokerMojo.runBuild(AbstractInvokerMojo.java:1307)
        at 
org.apache.maven.plugin.invoker.AbstractInvokerMojo.runBuild(AbstractInvokerMojo.java:1048)
        at 
org.apache.maven.plugin.invoker.AbstractInvokerMojo.runBuilds(AbstractInvokerMojo.java:974)
        at 
org.apache.maven.plugin.invoker.AbstractInvokerMojo.execute(AbstractInvokerMojo.java:626)
        at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)

I would expect it to either set some.property to "${example.property}" or an 
empty string.

The attached testcase has two profiles, profile-with-value and 
profile-with-empty-value.  With profile-with-value activated, mvn package 
passes.  With profile-with-empty-value, or no profile activated, mvn package 
will fail with the NullPointerException.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to