Mojo's Versions Maven Plugin
  1. Mojo's Versions Maven Plugin
  2. MVERSIONS-105

versions-maven-plugin display-plugin-updates fails on 3.0-beta-1 while working on 3.0-alph-*

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.2
    • Labels:
      None
    • Number of attachments :
      1

      Description

      The versions plugin has been working with the alpha releases of maven-3 but the display-plugin-updates goal fails on beta-1. You can create a project with only a pom.xml referencing the versions plugin to demonstrate the failure.

      the failure stack is:

      [ERROR] Failed to execute goal org.codehaus.mojo:versions-maven-plugin:1.1:display-plugin-updates (default-cli) on project foobar: Execution default-cli of goal org.codehaus.mojo:versions-maven-plugin:1.1:display-plugin-updates failed. NullPointerException -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:versions-maven-plugin:1.1:display-plugin-updates (default-cli) on project foobar: Execution default-cli of goal org.codehaus.mojo:versions-maven-plugin:1.1:display-plugin-updates failed.
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:149)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:77)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:69)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:82)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:54)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.singleThreadedBuild(DefaultLifecycleExecutor.java:218)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:190)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:246)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:95)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:430)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:160)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:124)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.codehaus.mojo:versions-maven-plugin:1.1:display-plugin-updates failed.

        Issue Links

          Activity

          Hide
          Gabe Beged-Dov added a comment -

          affects version(s) field should be 3.0-beta-1, not 3.1...

          Show
          Gabe Beged-Dov added a comment - affects version(s) field should be 3.0-beta-1, not 3.1...
          Hide
          Benjamin Bentmann added a comment -

          The plugin uses reflection to access implementation details which have changed:

          private Set getBoundPlugins( MavenProject project, String thePhases )
              throws PluginNotFoundException, LifecycleExecutionException, IllegalAccessException
          {
              // I couldn't find a direct way to get at the lifecycles list.
              List lifecycles = (List) ReflectionUtils.getValueIncludingSuperclasses( "lifecycles", lifecycleExecutor );
          

          Restoring compat with Maven 3 should be rather simple: The entire method is superfluos as the lifecycle bindings are already present in the POM, plugins no longer need to manually query the lifecycle to figure out what plugins are used for a project.

          Show
          Benjamin Bentmann added a comment - The plugin uses reflection to access implementation details which have changed: private Set getBoundPlugins( MavenProject project, String thePhases ) throws PluginNotFoundException, LifecycleExecutionException, IllegalAccessException { // I couldn't find a direct way to get at the lifecycles list. List lifecycles = (List) ReflectionUtils.getValueIncludingSuperclasses( "lifecycles" , lifecycleExecutor ); Restoring compat with Maven 3 should be rather simple: The entire method is superfluos as the lifecycle bindings are already present in the POM, plugins no longer need to manually query the lifecycle to figure out what plugins are used for a project.
          Hide
          Pether Sorling added a comment - - edited

          removed method calls not needed anymore. Not sure if this will work for maven2, but fixed my problem.

          Based on Benjamin Bentmann comment.

          Show
          Pether Sorling added a comment - - edited removed method calls not needed anymore. Not sure if this will work for maven2, but fixed my problem. Based on Benjamin Bentmann comment.
          Hide
          Stephen Connolly added a comment -

          r12156

          Show
          Stephen Connolly added a comment - r12156

            People

            • Assignee:
              Stephen Connolly
              Reporter:
              Gabe Beged-Dov
            • Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: