Maven
  1. Maven
  2. MNG-4586

Plugin prefix can't be resolved from plugin management if management entry is missing plugin version

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0-alpha-7
    • Fix Version/s: 3.0-beta-1
    • Component/s: Plugins and Lifecycle
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      For a POM snippet like

      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.its.plugin</groupId>
              <artifactId>maven-it-plugin-expression</artifactId>
              <!-- version omitted -->
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
      

      and the command "mvn itexpression:eval" we end up with

      [WARNING] Failed to retrieve plugin descriptor for Plugin [org.apache.maven.its.plugin:maven-it-plugin-expression]: null
      java.lang.NullPointerException
              at org.apache.maven.plugin.DefaultPluginDescriptorCache$CacheKey.<init>(DefaultPluginDescriptorCache.java:148)
              at org.apache.maven.plugin.DefaultPluginDescriptorCache.createKey(DefaultPluginDescriptorCache.java:61)
              at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:121)
              at org.apache.maven.plugin.DefaultBuildPluginManager.loadPlugin(DefaultBuildPluginManager.java:61)
              at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolveFromProject(DefaultPluginPrefixResolver.java:127)
              at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolveFromProject(DefaultPluginPrefixResolver.java:114)
              at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:74)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.findPluginForPrefix(DefaultLifecycleExecutor.java:1798)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1536)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.calculateTaskSegments(DefaultLifecycleExecutor.java:863)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.calculateProjectBuilds(DefaultLifecycleExecutor.java:751)
      ...
      [ERROR] No plugin found for prefix 'itexpression' in the current project [...]
      

        Activity

        Hide
        Benjamin Bentmann added a comment -

        Fixed in r921932.

        Show
        Benjamin Bentmann added a comment - Fixed in r921932 .
        Hide
        Paul Benedict added a comment -

        Are the dashes really irrelevant for the command?

        Show
        Paul Benedict added a comment - Are the dashes really irrelevant for the command?
        Hide
        Benjamin Bentmann added a comment -

        Sorry, not sure what you mean.

        Show
        Benjamin Bentmann added a comment - Sorry, not sure what you mean.
        Hide
        Paul Benedict added a comment -

        The command given was "mvn itexpression:eval" but the plugin is maven-it-plugin-expression. So Maven recognizes plugin names even without the dashes?

        Show
        Paul Benedict added a comment - The command given was "mvn itexpression:eval" but the plugin is maven-it-plugin-expression. So Maven recognizes plugin names even without the dashes?
        Hide
        Benjamin Bentmann added a comment -

        "itexpression" is the prefix for the plugin as given in its plugin descriptor.

        Show
        Benjamin Bentmann added a comment - "itexpression" is the prefix for the plugin as given in its plugin descriptor.

          People

          • Assignee:
            Benjamin Bentmann
            Reporter:
            Benjamin Bentmann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: