0

First a tiny bit of background:

  • I'm working on a large application for which the development started around 2008 (so as you can imagine, it's huge with loads of dependencies of which part are already unsupported/outdated)
  • I have a git branch with the current (developer) version, as well as a bunch of other branches with earlier versions (and some other branches like master and such, but those are irrelevant for now)

These days, every time I switch from the current branch to an older branch to do some hotfixes, the Maven update and Clean build work fine. However, when I switch back after the hotfix is done to the current branch, and do a Maven update, I get the following error:

enter image description here

This is a pretty well-known error based on some earlier stackoverflow questions I saw. Most answers you'd find will say to remove the entire .settings and .project files, and re-import the project; or to remove the .metadata of your workspace, and restart Eclipse. In the past I remembered using this solution of only deleting the .metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi file of the workspace, so the damage to your Eclipse project settings is limited. However, it doesn't always work, and I'm also getting a bit tired of getting this exception every single time I switch back and forth from a branch..

Note that I've already tried a bunch of other things without much avail:

  • Removing my entire .m2 folder and letting it download everything from our Nexus again
  • Looked in the Maven Console to see what is being logged, which isn't anything related to this NPE unfortunately
  • Do the Maven Update Project both with or without "Force Update of Snapshots/Releases" enabled
  • Do a Clean Build with the "Update Snapshots" enabled

What I'm mainly looking for right now is a stacktrace of this NullPointerException, so I can (hopefully) fix this issue at the core of the problem, instead of using all these workarounds like deleting Eclipse/Maven folders and/or settings (which only work halve of the time anyway)..

It gives a NullPointerException, so I assume I should be able to see the stacktrace of this NullPointerException to determine the cause somewhere in an Eclipse log or console, shouldn't I?

Is there perhaps a mvn command flag/argument I could use? Or is this NullPointerException an issue of Eclipse rather than Maven?

Kevin Cruijssen
  • 9,153
  • 9
  • 61
  • 135
  • 1
    Window -> Show View -> Error log – helospark Sep 25 '19 at 13:54
  • 1
    @helospark Thanks, that's what I was looking for! Apparently it gives the error `at org.eclipse.wst.common.componentcore.internal.resources.VirtualFolder.getFirstTaggedResource(VirtualFolder.java:185)`, which is also known in [some other SO questions](https://stackoverflow.com/questions/19779141/eclipse-throws-nullpointerexception-during-maven-update), as well as a [known Eclipse bug](https://bugs.eclipse.org/bugs/show_bug.cgi?id=480643). I tried [this approach](https://www.eclipse.org/forums/index.php/t/1091578/), but suggested line is getting removed by Eclipse. But at least I can continue. – Kevin Cruijssen Sep 25 '19 at 14:17

0 Answers0