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.

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

Reply via email to