This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
This bug was originally marked as duplicate of bug 166808, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE 6.8 (Build 200912041610) VM: Java HotSpot(TM) 64-Bit Server VM, 14.3-b01, Java(TM) SE Runtime Environment, 1.6.0_17-b04 OS: Windows Vista User Comments: GUEST: show dependency graph for one maven project (which is a module of another parent project) GUEST: Generating the Maven dependency graph from the NetBeans menu command. GUEST: After "Downloading libraries" in status bar when trying to construct maven dependency graph GUEST: Opening Dependency graph ("Indexing Repo :Local Repository" was in progress) GUEST: Displaying Dependency Graph GUEST: showing maven dependency graph GUEST: Displaying Dependency Graph Viewer GUEST: trying to view a dependency graph. (Didn't load sucessfully, is stuck on the loading page) GUEST: Can't build maven project graph. Happened after netbeans restart. Previously built all graphs successfully. GUEST: Right clicked "Libraries" and tried to make dependency graph. smsmithee: Tried to view maven dependency graph GUEST: Displaying dependency graph for maven project. malfunction84: Attempting to view dependency graph GUEST: Selected view dependency graph on a maven project. Project was not indicating any problems, just wanted to see the graph. summersb: viewing a pom dependency graph Stacktrace: java.lang.NullPointerException at org.netbeans.modules.maven.graph.ArtifactWidget.<init>(ArtifactWidget.java:124) at org.netbeans.modules.maven.graph.DependencyGraphScene.attachNodeWidget(DependencyGraphScene.java:185) at org.netbeans.modules.maven.graph.DependencyGraphScene.attachNodeWidget(DependencyGraphScene.java:96) at org.netbeans.api.visual.graph.GraphScene.addNode(GraphScene.java:97) at org.netbeans.modules.maven.graph.GraphConstructor.endVisit(GraphConstructor.java:129) at org.apache.maven.shared.dependency.tree.DependencyNode.accept(DependencyNode.java:317)
Created attachment 94439 [details] stacktrace
This bug already has 20 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=165622
Not realizing this exception had been refiled as a new bug, I attached my pom to the original (bug 166808).
This fixes the symptoms. DependencyNode passed to ArtifactGraphNode should not be null. Tested with pom.xml snippets with excludes provided in the issue 166808. Artifacts which are not completely excluded, only some of dependency paths to them are excluded, are now correctly created in the graph and only the remaining dependency paths are correctly shown. http://hg.netbeans.org/core-main/rev/508a0b6d5a62 Dafe, review the fix.
Well, I was working on this as well - please add some note or take the bug next time so that we are not working on one issue twice, thanks. The fix is actually a working workaround, but it's probably the best what we can do for now. Real bug is in Maven model and dependency tree builder. Let me explain - bug appears on poms with following dependencies structure: <dependencies> A (which depends on C) B excludes C </dependencies> So it's case of "unsuccessful exclusion" where both A and B depends on C, but dependency is excluded only halfway. Note that order is important here, A must go before B in pom, otherwise bug is not present. Actual bug is that in Maven dependency tree model, there is entry of C with wrong state - DependencyNode.OMITTED_FOR_DUPLICATE, but should be DependencyNode.INCLUDED. Anyway thanks for fixing, fix works OK.
Good!
Integrated into 'main-golden', will be available in build *201004020200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/508a0b6d5a62 User: Antonin Nebuzelsky <anebuzelsky@netbeans.org> Log: #181108: NullPointerException at org.netbeans.modules.maven.graph.ArtifactWidget.<init>
v.