An internal error occurred during: “Updating Maven

2019-03-07 22:09发布

As the title mentioned I have the following problem: I use Eclipse with Maven Nature and when I update my Maven Project, I get this error:

An internal error occurred during: "Updating Maven Project".
Unsupported IClasspathEntry kind=4

The solution that always comes back is the following:

  • rightclick project, remove maven nature
  • mvn eclipse:clean (with project open in eclipse/STS)
  • (sometimes they suggest to do mvn eclipse:eclipse next)
  • rightclick project and reenable maven nature

Now I exhaustively tried all combinations several times. But I always keep getting the above error. The error starting occurring when I had to mvn eclipse:eclipse the project. Before it was always running fine using only m2eclipse features and setting everything in eclipse.

13条回答
Root(大扎)
2楼-- · 2019-03-07 22:26
  • I just went to Properties -> Java Build Path -> Libraries and removed the blue entries starting with M2_REPO.

  • After that, I could use Maven -> Update Project again

查看更多
我命由我不由天
3楼-- · 2019-03-07 22:26

This issue (https://bugs.eclipse.org/394042) is fixed in m2e 1.5.0 which is available for Eclipse Kepler and Luna from this p2 repo :

http://download.eclipse.org/technology/m2e/releases/1.5

If you also use m2e-wtp, you'll need to install m2e-wtp 1.1.0 as well :

http://download.eclipse.org/m2e-wtp/releases/luna/1.1

查看更多
走好不送
4楼-- · 2019-03-07 22:28

I had to do it slightly different to work for me:

  1. rightclick project, remove maven nature (or in newer eclipse, "Maven->Disable Maven Nature")
  2. mvn eclipse:clean (with project open in eclipse/STS)
  3. delete the project in eclipse (but do not delete the sources)
  4. Import existing Maven project
查看更多
趁早两清
5楼-- · 2019-03-07 22:29

I solved this by looking at this comment on JBIDE-11655 : deleting all .project, .settings and .classpath in my projects folder.

查看更多
贪生不怕死
6楼-- · 2019-03-07 22:29

I removed my .classpath file in my project directory to correct this issue. No need to remove the Maven Nature from the project in Eclipse.

The specific error I was getting was: Project 'my-project-name' is missing required Java project: 'org.some.package-9.3.0 But my project wasn't dependent on org.some.package in any way.

Perhaps an old version of the project relied on it and Maven wasn't properly updating the .classpath file.

查看更多
爷、活的狠高调
7楼-- · 2019-03-07 22:30

I imported the project as general project from git repository.

  • Deleted .settings, .project and .classpath in project's folder
  • Configure -> Convert to Maven Project. Only this solved the problem in my case.
查看更多
登录 后发表回答