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. patch.txt
        1.0 kB
        Matthew Beermann
      2. daveBodenPatch.txt
        4 kB
        David Boden

        Issue Links

          Activity

          No work has yet been logged on this 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