Hi, I see the Maven implementation as the correct one (this is a copy of the reasoning in the PR):
-------------- My scenario I tested: - I create a project `library` (just a `DemoLib` class with a `dummyMethod`) - I `maven -Prelease-profile install`ed version `1.0`, `2.0` and `3.0-SNAPSHOT` - I created an application project that depends on library version `3.0-SNAPSHOT`, both projects are open in netbeans - I invoke "Navigate -> Go to Source" on `demoLib.dummyMethod()` At this point netbeans takes me to the code in the project that I have open. - I change the dependency to `2.0` - I invoke "Navigate -> Go to Source" on `demoLib.dummyMethod()` At this point the source code of the source jar is opened and shown. - I checkout version `2.0` of `library` - I invoke "Navigate -> Go to Source" on `demoLib.dummyMethod()` At this point I'm taken to the source of the open project. >From my perspective the behavior of the Integration of Maven in NetBeans in completely sane: If you have the source for a maven project open _and_ the version of the project matches the version of the dependency then the project source code is used, else the source jar is used to show the source. If you don't do this, you will get misleading results. I once accidentally chased a bug that I misdiagnosed, because the lines in the source code did not match the one in the stack trace because I had the wrong version opened. IMHO this would be a sane implementation for gradle as well. And here is the code I used to test: [TestVersions.zip](https://github.com/apache/netbeans/files/4073228/TestVersions.zip) -------------- So I would say implement it like describe above for maven is the right thing to do. If a different implementation is switched on by default for gradle user experience will suffer, because behavior of the IDE differes between project types. I doubt, that a switch is a good idea, as people tend to not understand the consequences of their choices and at the end we have to deal with bugs where people shot themselfes into the their food. Greetings Matthias Am Dienstag, den 14.01.2020, 13:30 -0800 schrieb Laszlo Kishalmi: > Dear all, > > Please tell me how the IDE shall be working, regarding > https://issues.apache.org/jira/browse/NETBEANS-3115 > > Summary: When two otherwise independent Gradle projects has declared > dependency over a released artifact through a repository, shall > sources > loaded from the available released sources.jar in the repository, or > shall we try to open the source form the opened project? > > Right now the Gradle plugin behaves semantically correct as it is > opening the source from the released source jar file from the local > repository cache. Creating a composite build of these projects could > help. See: https://github.com/apache/netbeans/pull/1861 > > However I have another implementation which does not need the > include > build (as that might be side effects). My question is the following. > Shall the resolving the third party source against opened projects > be > the default behavior or shall it be put behind a switch and if it is > behind the switch what shall be the default behavior. > > Let me do a poll on this, so reply with the following if you care,: > > - enabled > - switch, enabled > - switch, disabled > > > The poll will be open for at least 3 days. > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists