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 Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-3
    • Fix Version/s: 2.0.1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      2

      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
          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:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: