felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart McCulloch <mccu...@gmail.com>
Subject Re: NullPointerException in maven-bundle-plugin:3.0.1
Date Wed, 27 Jan 2016 09:49:55 GMT
On Wednesday, 27 January 2016 at 06:03, Stephen Evanchik wrote:
> Hi everyone,
> 
> I'm having trouble tracking down an intermittent but frequent build failure
> using the maven-bundle-plugin to wrap non-OSGi projects. I'm using Maven
> 3.3.1 and see the following NPE:
> 
> Caused by: java.lang.NullPointerException
> at
> org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder.buildDependencyGraph(DefaultDependencyGraphBuilder.java:60)
> at
> org.apache.felix.bundleplugin.BundlePlugin.buildDependencyGraph(BundlePlugin.java:334)
> at
> org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:359)
> at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
> ... 11 more
> 
> whenever I invoke a parallel build (-T2.0C for example).
> 
> There are many projects that will fail with this exception. I can provide a
> fairly simple one if that makes sense.
> 
> 

a reproducible test project is always helpful - have you tried a more recent version of Maven
like 3.3.3 or 3.3.9 to see if that helps?
> It looks like the 3.0.1 version is using maven-dependency-tree-2.1 whose
> buildDependency method looks like:
> 
> public DependencyNode buildDependencyGraph( MavenProject project,
> ArtifactFilter filter )
> throws DependencyGraphBuilderException
> {
> try
> {
> String hint = isMaven31() ? "maven31" : isMaven2x() ? "maven2"
> : "maven3";
> getLogger().debug( "building " + hint + " dependency graph for
> " + project.getId() );
> 
> DependencyGraphBuilder effectiveGraphBuilder =
> (DependencyGraphBuilder) container.lookup(
> DependencyGraphBuilder.class.getCanonicalName(), hint );
> 
> 
> where the NPE is on:
> 
> DependencyGraphBuilder effectiveGraphBuilder =
> (DependencyGraphBuilder) container.lookup(
> DependencyGraphBuilder.class.getCanonicalName(), hint );
> 
> 
> I'm not sure why this could NPE as it seems like the
> Contextualizable.contextualize() is called successfully for other projects
> in the build.
> 
> Any ideas on how to track this down? I can't enable debugging (mvn -X)
> because that affects the timing just enough to avoid the issue.
> 
> Thanks,
> Stephen



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message