Hi Stuart, I am using Maven 3.3.3 please disregard my earlier email. I did see this problem in 3.3.1 so there doesn't seem to be a difference. I am going to try with 3.3.9 but I'm not going to hold out hope that it will make a difference.
I think the problem is that DefaultDependencyGraphBuilder does not get initialized properly. This only occurs in parallel builds and is strongly associated with relative timing. For example, if I issue a mvn -T2.0C install I will see the failure >80% of the time but if I use mvn -X -T2.0C I cannot reproduce the failure at all. I'm not sure embedding a pom is the right approach but here's a pastbin link to a sample project that fails: https://paste.apache.org/dpeQ Stephen On Wed, Jan 27, 2016 at 4:49 AM, Stuart McCulloch <mccu...@gmail.com> wrote: > 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 > > > -- Stephen Evanchik http://stephen.evanchik.com