Maven
  1. Maven
  2. MNG-4858

NullPointerException if goal name is malformed

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.0.1
    • Component/s: Errors
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      Typing a goal like:

      mvn help:
      

      or

      mvn group:artifact:version:goal:onetoomany
      

      Results in:

      [ERROR] NullPointerException
      java.lang.NullPointerException
      	at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPlugin(MojoDescriptorCreator.java:288)
      	at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.injectPluginDeclarationFromProject(MojoDescriptorCreator.java:268)
      	at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:211)
      	at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106)
      	at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:98)
      

      In Maven 2.2.1, it produced an error message to adjust the goal format.

        Activity

        Hide
        Brett Porter added a comment -

        Fixed in r1005860. After discussing with Benjamin, decided not to go for an IllegalArgumentException as it would not represent a clear error link to the user receiving it. Instead, the empty goal or overspecified goal (goal:toomany) are sent to the MojoNotFoundException so the user ends up getting back valid choices of goals from the plugin in question.

        Show
        Brett Porter added a comment - Fixed in r1005860. After discussing with Benjamin, decided not to go for an IllegalArgumentException as it would not represent a clear error link to the user receiving it. Instead, the empty goal or overspecified goal (goal:toomany) are sent to the MojoNotFoundException so the user ends up getting back valid choices of goals from the plugin in question.

          People

          • Assignee:
            Brett Porter
            Reporter:
            Brett Porter
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: