Eclipse throws NullPointerException during Maven update

前端 未结 6 1053
难免孤独
难免孤独 2020-12-18 21:24

I\'ve been fighting an internal Eclipse error for two days. I\'m running the latest Spring Tool Suite edition of Eclipse, and I\'ve attempting to import a collection of exis

相关标签:
6条回答
  • 2020-12-18 21:58

    This is what I did to fix it:

    1. Removed the project from the workspace
    2. Remove .classpath, .project and .settings folder
    3. Reimport the project
    0 讨论(0)
  • 2020-12-18 22:05

    As echinelli indicated, this did turn out to be an Eclipse (or STS) bug, but installing the latest version isn't the fix, as I already had that version installed. I had installed STS based on Eclipse 4.x; when I uninstalled that and went to the 3.x version, the problem went away.

    0 讨论(0)
  • 2020-12-18 22:05

    Ok, I had the same issue with a more obscure reason.

    I used pluginExecution for aspectj-maven-plugin and over the course of trying to fix yet another maven issue I had commented out <action><execute><execute></action>

    This leads to the nullpointerexception.

    0 讨论(0)
  • 2020-12-18 22:06

    This happens because your m2e plugins are corrupted. To rectify follow the steps below.

    1. close eclipse
    2. Go to your eclipse workspace folder Under .metadata/pluigns folder, identify all m2e plugins
    3. delete them
    4. copy the relevant plugins from non-corrupted workspace, either from your machine or from any one of your team members machine
    5. restart eclipse
    0 讨论(0)
  • 2020-12-18 22:11

    I'm strongly sure that the problem is not related to the maven plugin; but if it is, i was wandering if you run a mvn eclipse:eclipse before importing the project into eclipse, if you do that and you are using maven 3, I had checked that maven plugin does not support maven 3 properly yet; so I encourage you to make a mvn eclipse:clean, then import the project as an existing project, and after that activate the maven plugin nature from eclipse. I hope it helps,

    PS. it seems to be a know eclipse bug (https://www.google.com.uy/search?q=j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java&oq=j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java&aqs=chrome..69i57.128j0j7&sourceid=chrome&espv=210&es_sm=91&ie=UTF-8); try downloading the last eclipse version; I'm using kepler at work, and I'm working in maven/spring projects and it works fine.

    Good luck!

    0 讨论(0)
  • 2020-12-18 22:14

    I solved by adding the <build> section with "maven-compiler-plugin" artifact in the POM. I noticed that without it, Eclipse threw a java.lang.NullPointerException.

    0 讨论(0)
提交回复
热议问题