Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6
-
None
-
Maven 3.0.2
Description
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.