Why would IntelliJ be displaying an old version of...
# intellij
r
Why would IntelliJ be displaying an old version of a library that's no longer used by direct or transitive dependencies (under "External libraries")? It persists after doing a restart and rebuild, and refreshing Maven indices. 😞
c
does that library show up in a Gradle build scan?
r
Only the new version shows up when I do
mvn dependency:tree
or other related commands (not sure if Gradle build scan is something I can run separately).
Hmm, interestingly it's showing two types of libraries. One is just the jar file, and the other is the actual "maven" resource. Perhaps some strange scenario lead to the jar files being permanently added to the library settings?
c
perhaps some of those are annotation processors or similar, in a different scope. not that familiar with Maven on how to get the right info out for those.
r
That could also explain why I've been seeing test dependencies and IntelliJ internals show up as suggestions. 🤔
I am not quite sure myself. I am going to try manually deleting everything from the library settings and see what happens. ¯\_(ツ)_/¯
c
is it possible those JARs are in a directory that IntelliJ has been configured to have as a module?
a
Try to remove .idea directory and reimport / reopen the project.
r
That worked. When in doubt,
rm -rf
and try again. 🙂
Thanks for the suggestions Chris & Alexey.
👍 2
w
When in doubt,
rm -rf
and try again. 🙂
Fyi a good alternative is
git clean -fxdn
which will list all non-tracked files to delete. Then if all looks good,
git clean -fxd
to remove them. This is basically a clean
git clone
that leaves all your local branches but clears IJ, build and Gradle stuff
👍 1