Uploaded image for project: 'Maven Invoker Plugin'
  1. Maven Invoker Plugin
  2. MINVOKER-118

Specifying an unset property in <properties> causes a NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6
    • 1.8
    • 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.

      Attachments

        1. maven-invoker-plugin-bug.zip
          2 kB
          Derek Lewis

        Activity

          People

            rfscholte Robert Scholte
            lewisd Derek Lewis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: