How to fix error “Updating Maven Project”. Unsupported IClasspathEntry kind=4?

前端 未结 15 1694
自闭症患者
自闭症患者 2020-12-02 03:44

I have imported maven project in STS, when I run update update project I receive:

\"Updating Maven Project\". Unsupported IClasspathEntry kind=4
相关标签:
15条回答
  • 2020-12-02 03:49
    1. Right-click on your project, select Maven -> Remove Maven Nature.

    2. Open you terminal, go to your project folder and do mvn eclipse:clean

    3. Right click on your Project and select “Configure -> Convert into Maven Project”

    Now you got “Unsupported IClasspathEntry kind=4 Eclipse Scala” disappear.

    0 讨论(0)
  • 2020-12-02 03:51

    This issue has been fixed in m2e 1.5.0 which is available for Eclipse Kepler (4.3) and Luna (4.4)

    Please see https://bugs.eclipse.org/bugs/show_bug.cgi?id=374332#c14

    The problem is caused by the fact that STS (the Spring IDE/Eclipse), as well Eclipse and other Eclipse based IDE's, use the m2e(clipse) plugin but that eclipse:eclipse has been probably been run on the project. When m2e encounters a "var" .classpath entry, it throws this error.

    The update sites are specified at the following url:
    http://eclipse.org/m2e/m2e-downloads.html

    If you can't use m2e 1.5.0 for any reason, then :

    1. Disable the maven nature for the project (via the right-click menu)

    2. Run mvn eclipse:clean (while your project is open in STS/eclipse). Depending on the timing, you might need to do a refresh or two on the project before re-enabling the maven nature. You should be able to see that your project has lost it's Maven nature. (The eclipse:clean goal just deletes the .project, .classpath and .settings/ files/directories. You can also just remove those files (again while the project is open) instead of running mvn eclipse:clean.)

    3. Re-enable the maven nature.
      (Most of the time, this can be done by right-clicking on the project in question in the package explorer pane, and then choosing 'Configure'-> 'Convert to Maven Project')

    0 讨论(0)
  • 2020-12-02 03:51

    Sometimes, even re-importing the Maven project will not work. Updating the project correctly in eclipse is not a deterministic process. The only 100% fail safe procedure I've found is:

    1. Disable Maven Nature, run mvn eclipse:clean, restart, cross your fingers and Pray 3 times.
    2. If this won't work, delete the project, run mvn eclipse:clean, re-import refresh, pray and use the force.
    3. If this still doesn't work, restart Eclipse, or even better your computer. While waiting for the reboot, you can make a random donation to fix your Karma. Repeat step 2 and don't forget to pray and control your anger. Anger leads to hate. Hate leads to suffering.
    4. Try all the other answers posted in this thread. You might need to try them all for 3 times at least before giving up.
    5. Format your Computer, re-install Eclipse and Maven. No need to pray anymore, all gods hate you anyway
    6. Delete your git project, burn the physical drive that stored the remote repository, and write your project from scratch.
    7. Find a time machine, travel to the past and convince yourself to follow another, non-programming career or at least to avoid Java
    0 讨论(0)
  • 2020-12-02 03:52

    I tried Marco's steps but no luck. Instead if you just get the latest m2e plugin from the link he provides and one by one right click on each project -> Maven -> Update Dependencies the error still pops up but the issue is resolved. That is to say the warnings disappear in the Markers view. I encountered this issue after importing some projects into SpringSource Tool Suite (STS). When I returned to my Eclipse Juno installation the warnings were displaying. Seeing that I had m2e 1.1 already installed I tried Marco's steps to no avail. Getting the latest version fixed it however.

    0 讨论(0)
  • 2020-12-02 03:53

    I couldn't get mvn eclipse:clean etc to work with Kepler.

    However I changed creating and extending variables to just using external jars in my eclipse classpath. This was reflected in no var's in my .classpath.

    This corrected the problem. I was able to do a Maven update.

    0 讨论(0)
  • 2020-12-02 03:57
    1. Make sure that the version of the m2e(clipse) plugin that you're running is at least 1.1.0

    2. Close maven project - right click "Close Project"

    3. Manualy remove all classpathentry with kind="var" in .classpath file
    4. Open project

    or

    1. Remove maven project
    2. Manualy rmeove .classpath 4 Reimport project
    0 讨论(0)
提交回复
热议问题