netbeans
netbeans copied to clipboard
Maven Project Dependency Replaced with JAR, Breaking Source Navigation
Apache NetBeans version
Apache NetBeans 25
What happened
When adding an open Maven library project as a dependency to another Maven project in NetBeans 25, the IDE sometimes silently replaces the project reference with the compiled JAR file from the local repository. This breaks:
"Go to Source" navigation (Ctrl+Click).
Real-time dependency updates (changes in the library project aren’t reflected until rebuilt).
Language / Project Type / NetBeans Component
Java Maven Swing project
How to reproduce
Open two Maven projects in NetBeans 25:
Project A (main project)
Project B (dependency library).
In Project A, add Project B as a dependency via:
Right-click Dependencies / Add Project / Open Projects / Select Project B.
Verify it works (Ctrl+Click on a method call in Project A navigates to Project B’s source).
Perform one of these actions:
It is unknown at this point what actions cause the issue to occur, it happens after a few days work and with different projects, sometimes several at a time.
Did this work correctly in an earlier version?
No / Don't know
Operating System
Linux Mint Debian Edition 6 (LMDE 6)
JDK
zulu21.34.19-ca-fx-jdk21.0.3-linux_amd64.deb
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
The issue occurs every few days. The workaround is to remove the jar dependency and manually re-add the open project dependency, but this is temporary.
Are you willing to submit a pull request?
No