[ 
https://issues.apache.org/jira/browse/MINVOKER-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17958351#comment-17958351
 ] 

Olivier Lamy commented on MINVOKER-118:
---------------------------------------

This project has moved from Jira to GitHub Issues. This issue was migrated to 
[apache/maven-invoker-plugin#418|https://github.com/apache/maven-invoker-plugin/issues/418].
 

> Specifying an unset property in <properties> causes a NullPointerException
> --------------------------------------------------------------------------
>
>                 Key: MINVOKER-118
>                 URL: https://issues.apache.org/jira/browse/MINVOKER-118
>             Project: Maven Invoker Plugin (Moved to GitHub Issues)
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: Maven 3.0.2
>            Reporter: Derek Lewis
>            Assignee: Robert Scholte
>            Priority: Major
>             Fix For: 1.8
>
>         Attachments: maven-invoker-plugin-bug.zip
>
>
> When the invoker plugin is configured with a property as follows:
> {code:xml}
> <properties>
>       <some.property>${example.property}</some.property>
> </properties>
> {code}
> If {{example.property}} is not set, the plugin throws a 
> {{NullPointerException}}:
> {noformat}
> 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)
> {noformat}
> 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 was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to