Maven Project Info Reports Plugin
  1. Maven Project Info Reports Plugin
  2. MPIR-2

Dependencies report throws NullPointerException when a transitive dependency has system scope

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-3
    • Fix Version/s: 2.0.1
    • Component/s: None
    • Labels:
      None

      Description

      DependenciesReport.java, inside getMavenProjectFromRepository( Artifact artifact, ArtifactRepository localRepository )

      projectArtifact.file is always null, and when calling mavenProjectBuilder.buildFromRepository causes

      java.lang.NullPointerException
      at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:82)
      at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:63)
      at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:377)
      at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:343)
      at org.apache.maven.report.projectinfo.DependenciesReport$DependenciesRenderer.getMavenProjectFromRepository(DependenciesReport.java:373)
      at org.apache.maven.report.projectinfo.DependenciesReport$DependenciesRenderer.renderBody(DependenciesReport.java:297)
      at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65)

      I've made a quick fix ignoring system dependencies, not sure if we want to change it
      Inside renderBody
      if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) )

      { continue; }
      1. daveBodenPatch.txt
        4 kB
        David Boden
      2. patch.txt
        1.0 kB
        Matthew Beermann

        Issue Links

          Activity

          Hide
          Siveton Vincent added a comment -

          artifactProject = getMavenProjectFromRepository(...) is only used to get url and description.
          So, the report puts these informations in the dependencies table.

          Maybe, we could add the SCOPE_SYSTEM test and thus, skipping the display of url and description.

          Show
          Siveton Vincent added a comment - artifactProject = getMavenProjectFromRepository(...) is only used to get url and description. So, the report puts these informations in the dependencies table. Maybe, we could add the SCOPE_SYSTEM test and thus, skipping the display of url and description.
          Hide
          Siveton Vincent added a comment -

          Applied in svn

          Show
          Siveton Vincent added a comment - Applied in svn
          Hide
          Bernd Bohmann added a comment -

          This is a duplicate of
          http://jira.codehaus.org/browse/MNG-1455

          Can you apply the suggested patch please?

          Or close 1455?

          Show
          Bernd Bohmann added a comment - This is a duplicate of http://jira.codehaus.org/browse/MNG-1455 Can you apply the suggested patch please? Or close 1455?
          Hide
          Carlos Sanchez added a comment -

          Reopen to change fix version

          Show
          Carlos Sanchez added a comment - Reopen to change fix version
          Hide
          Julian Wood added a comment -

          I'm still seeing this issue as of maven 2.0.4, May 2nd, 2006. So still can't make a dependency report if there is a system-scoped dep.

          Show
          Julian Wood added a comment - I'm still seeing this issue as of maven 2.0.4, May 2nd, 2006. So still can't make a dependency report if there is a system-scoped dep.
          Hide
          Carlos Sanchez added a comment -

          You need to use the 2.0 version of the maven-project-info-report plugin, that will be released in the following days

          Show
          Carlos Sanchez added a comment - You need to use the 2.0 version of the maven-project-info-report plugin, that will be released in the following days
          Hide
          Matthew Beermann added a comment -

          I don't have the authority to reopen bugs, but I just tested using the 2.0 version of MPIR and the bug still seems to be present. The NPE is in the same place; however, the stack trace looks slightly different from the one originally posted here...

          [INFO] Generate "Dependencies" report.
          [INFO] ------------------------------------------------------------------------
          [ERROR] FATAL ERROR
          [INFO] ------------------------------------------------------------------------
          [INFO] null
          [INFO] ------------------------------------------------------------------------
          [DEBUG] Trace
          java.lang.NullPointerException
          at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:82)
          at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:63)
          at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:467)
          at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:225)
          at org.apache.maven.report.projectinfo.DependenciesReport$DependenciesRenderer.getMavenProjectFromRepository(DependenciesReport.java:456)
          at org.apache.maven.report.projectinfo.DependenciesReport$DependenciesRenderer.printDescriptionsAndURLs(DependenciesReport.java:392)
          at org.apache.maven.report.projectinfo.DependenciesReport$DependenciesRenderer.printDescriptionsAndURLs(DependenciesReport.java:429)
          at org.apache.maven.report.projectinfo.DependenciesReport$DependenciesRenderer.renderBody(DependenciesReport.java:277)
          at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65)
          at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:97)
          at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:101)
          at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:67)
          at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:239)
          at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:115)
          at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:124)
          at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:92)
          at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
          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:585)
          at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
          at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
          at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
          at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

          Show
          Matthew Beermann added a comment - I don't have the authority to reopen bugs, but I just tested using the 2.0 version of MPIR and the bug still seems to be present. The NPE is in the same place; however, the stack trace looks slightly different from the one originally posted here... [INFO] Generate "Dependencies" report. [INFO] ------------------------------------------------------------------------ [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] null [INFO] ------------------------------------------------------------------------ [DEBUG] Trace java.lang.NullPointerException at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:82) at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:63) at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:467) at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:225) at org.apache.maven.report.projectinfo.DependenciesReport$DependenciesRenderer.getMavenProjectFromRepository(DependenciesReport.java:456) at org.apache.maven.report.projectinfo.DependenciesReport$DependenciesRenderer.printDescriptionsAndURLs(DependenciesReport.java:392) at org.apache.maven.report.projectinfo.DependenciesReport$DependenciesRenderer.printDescriptionsAndURLs(DependenciesReport.java:429) at org.apache.maven.report.projectinfo.DependenciesReport$DependenciesRenderer.renderBody(DependenciesReport.java:277) at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65) at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:97) at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:101) at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:67) at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:239) at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:115) at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:124) at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:92) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:256) 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:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
          Hide
          Carlos Sanchez added a comment -

          reopened per user comment

          Show
          Carlos Sanchez added a comment - reopened per user comment
          Hide
          Matthew Beermann added a comment -

          SImple fix, just needs a little more robustness

          Show
          Matthew Beermann added a comment - SImple fix, just needs a little more robustness
          Hide
          Matthew Beermann added a comment -

          Note: This is the identical patch to the one from MNG-1455, which was resolved as a duplicate of this issue - without applying the patch. So somebody please actually CHECK IT IN this time.

          Show
          Matthew Beermann added a comment - Note: This is the identical patch to the one from MNG-1455, which was resolved as a duplicate of this issue - without applying the patch. So somebody please actually CHECK IT IN this time.
          Hide
          David Boden added a comment -

          Here's a better patch. The problem with the other patch is that it leaves a dangling link on the "Dependency Tree". My version creates an entry in the "Dependency Listings" section and also tells us where on the user's hard disk the dependency is. If you decide this bit isn't useful, please delete and replace with info that you think is more appropriate.

          Show
          David Boden added a comment - Here's a better patch. The problem with the other patch is that it leaves a dangling link on the "Dependency Tree". My version creates an entry in the "Dependency Listings" section and also tells us where on the user's hard disk the dependency is. If you decide this bit isn't useful, please delete and replace with info that you think is more appropriate.
          Hide
          Joel Wiegman added a comment -

          This bug should not be closed. It is still happening in 2.0.7. Calling "mvn site:site" generates the following stack trace:

          [INFO] Generating "Dependencies" report.
          [INFO] ------------------------------------------------------------------------
          [ERROR] FATAL ERROR
          [INFO] ------------------------------------------------------------------------
          [INFO] null
          [INFO] ------------------------------------------------------------------------
          [INFO] Trace
          java.lang.NullPointerException
          at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:991)
          at java.lang.Double.parseDouble(Double.java:482)
          at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionDependencyFileDetails(DependenciesRenderer.java:375)
          at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderBody(DependenciesRenderer.java:165)
          at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65)
          at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:140)
          at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:101)
          at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:139)
          at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:266)
          at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:99)
          at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:130)
          at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:97)
          at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
          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:585)
          at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
          at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
          at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
          at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

          Show
          Joel Wiegman added a comment - This bug should not be closed. It is still happening in 2.0.7. Calling "mvn site:site" generates the following stack trace: [INFO] Generating "Dependencies" report. [INFO] ------------------------------------------------------------------------ [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] null [INFO] ------------------------------------------------------------------------ [INFO] Trace java.lang.NullPointerException at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:991) at java.lang.Double.parseDouble(Double.java:482) at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionDependencyFileDetails(DependenciesRenderer.java:375) at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderBody(DependenciesRenderer.java:165) at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65) at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:140) at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:101) at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:139) at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:266) at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:99) at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:130) at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:97) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) at org.apache.maven.cli.MavenCli.main(MavenCli.java:280) 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:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
          Hide
          Carlos Sanchez added a comment -

          joel, your stack trace is different

          Show
          Carlos Sanchez added a comment - joel, your stack trace is different
          Hide
          Joel Wiegman added a comment -

          True... that's why I posted it. But the defect is "Dependencies report throws NullPointerException when a transitive dependency has system scope", which is still what's happening. It's happening in a different place, but it's still happening.

          Show
          Joel Wiegman added a comment - True... that's why I posted it. But the defect is "Dependencies report throws NullPointerException when a transitive dependency has system scope", which is still what's happening. It's happening in a different place, but it's still happening.
          Hide
          Carlos Sanchez added a comment -

          open a new issue

          Show
          Carlos Sanchez added a comment - open a new issue

            People

            • Assignee:
              Carlos Sanchez
              Reporter:
              Carlos Sanchez
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development