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.
While browsing the libraries of a maven project, one can right-click on a library and choose the action "Exclude Dependecy". The POM will then have the corresponding exclude statement. At least it worked this way in Netbeans 6.5. In Netbeans 6.7, nothing happens. Even no red exception bullet in the lower right corner. ... but after some seconds (more than 30) or minutes, the exclude statement appears in the POM. But that operation should be very fast. BTW: I am running JDK 6 on 10.5.8
could you do a bunch of thread dumps right after the operation executes? There can be multiple sources of trouble. The most probable one is that we need to create a tree of dependencies (not the usual list) to figure what dependencies we shall add the exclusion element. I suppose it can take some time under certain circumstances.. how many transitive dependencies do you have? was the exclusion added to multiple dependencies? do you have any snapshot dependencies? do all of the dependencies (even transitive) provide a POM file in repository?
Created attachment 86660 [details] ThreadDump before the exclusion operation
Created attachment 86661 [details] ThreadDump after exclusion operation started (first)
Created attachment 86662 [details] Thread Dump after exclusion operation (second)
Created attachment 86663 [details] Thread Dump after exclusion operation (third)
Created attachment 86664 [details] Thread Dump after exclusion operation (fourth)
Created attachment 86665 [details] Thread Dump after exclusion operation has been finished
Created attachment 86666 [details] POM with huge amount of transitive dependencies
Created attachment 86667 [details] Settings file with the repositories
I have included some thread dumps. There are a lot of transitive dependencies (abount 50). I have attached the POM and the settings with the repositories for the project. I suspect that some of the transitive dependencies are snapshots - but I am not sure. But at least the POM files are all located in my local repository. I have downloaded them before excluding.
thanks. as suspected, the thread dumps reveal that network is touched during construction of the dependency tree. I guess the only *fix* is to wrap everything into a progress indicator..
OK, but to wait for about 60 seconds to simply exlude a dependency is a bit long - even with a progress indicator. From a users perspective, this is not acceptable (without background information). Do you mean the construction of the whole tree minus the excluded dependency takes about 60 seconds?
well I don't see a way to speed that up unfortunately. It's highly dependent on setup though. org.apache.maven.shared.dependency.tree.DependencyTreeBuilder is a maven originated class that is capable of creating the tree (used by the maven-dependency-plugin as well). The usual maven resolver that is processing the project doesn't store the tree structure but turns it immediately to the flat list which is then missing the tree attributes (eg. all paths to the transitive dependency - which is crucial to apply the exclusion(s) correctly) We just call the treebuilder and wait for it to create the tree. That's the part that is possibly slow in some cases, everything else shall be fairly fast.. when loading the project we use specially tweaked resolver/embedder that doesn't touch the network. it's fast but often produces incomplete results. So we need to use the full blown embedder here, but run the risk of it downloading the universe.. I don't see a way out..
-> not for 6.8, we might get a speed improvement when migrating to latest maven3 builds in the future, but the work being done still needs to be done (get a dependency tree)
Reassigning to default owner.
I tried with the latest 7.0 daily build and exclusion of a dependency is fast. 7.0 includes Maven 3 mentioned above. Can you please try with 7.0 Beta and confirm it is fast for you now? Thanks.