Maven 2.x Project Info Reports Plugin

Crash when processing system-scoped dependencies

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Duplicate
  • Affects Version/s: 2.0-beta-3
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

The Dependencies sub-report crashes if you have a dependency with <scope>system</scope> and a <systemPath/>. See below for traceback. I glanced at the code and a huge SWAG on my part is that it's assuming the dependency is a proper Maven 2 artifact - e.g. that it has a POM and such - but I'm probably completely off.

[INFO] ----------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ----------------------------------------------------------------------------
[INFO] null
[INFO] ----------------------------------------------------------------------------
[INFO] 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:386)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:351)
at org.apache.maven.report.projectinfo.DependenciesReport$DependenciesRenderer.getMavenProjectFromRepository(DependenciesReport.java:362)
at org.apache.maven.report.projectinfo.DependenciesReport$DependenciesRenderer.renderBody(DependenciesReport.java:242)
at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65)
at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:157)
at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
at org.apache.maven.plugins.site.SiteMojo.generateReportsPages(SiteMojo.java:802)
at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:301)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
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:249)
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)

Issue Links

Activity

Hide
Matthew Beermann added a comment -

In the interests of full disclosure, I am doing one slightly strange thing, but it seems like it ought to work anyway:

I've got a custom mojo which, at the beginning of the lifecycle, scans project.getDependencies() and looks for certain items which we might have a [different] local version for. If so, it quietly redirects the dependency, using dependency.setScope("system") and dependency.setSystemPath(path). Yes, it's a bit odd, but trust that I'm doing it for a good reason.

I thought that perhaps there was some "double-accounting" going on, and I needed to make the same change elsewhere in the system. But, all other goals in all other plugins except for this one work just fine. Which leads me to wonder if the dependencies report is making a bad assumption somewhere...

Show
Matthew Beermann added a comment - In the interests of full disclosure, I am doing one slightly strange thing, but it seems like it ought to work anyway: I've got a custom mojo which, at the beginning of the lifecycle, scans project.getDependencies() and looks for certain items which we might have a [different] local version for. If so, it quietly redirects the dependency, using dependency.setScope("system") and dependency.setSystemPath(path). Yes, it's a bit odd, but trust that I'm doing it for a good reason. I thought that perhaps there was some "double-accounting" going on, and I needed to make the same change elsewhere in the system. But, all other goals in all other plugins except for this one work just fine. Which leads me to wonder if the dependencies report is making a bad assumption somewhere...
Hide
Carlos Sanchez added a comment -

Dupe of MPIR-2

Show
Carlos Sanchez added a comment - Dupe of MPIR-2

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: