Successful build in Maven still showing errors in Eclipse

前端 未结 18 1728
猫巷女王i
猫巷女王i 2020-12-24 07:04

I\'m having something quite peculiar here, my build is successful in maven when I type \"mvn clean install\" however once imported into Eclipse it\'s showing errors.

相关标签:
18条回答
  • 2020-12-24 07:23

    It may help: After upgrading eclipse or changing it or something like, old eclipse specific files (.classpath, .project, and .settings) may not be compatible to the new version of eclipse. So you may have to re generate this eclipse specific files using Maven. So try this in your eclipse project root

    mvn eclipse:eclipse
    
    0 讨论(0)
  • 2020-12-24 07:25

    In my case,

    1. I just deleted project from Eclipse (not ticked checkbox to delete from project location).

    2. Opened project as "Existing Maven Project" again.

    and it solved my issue.

    0 讨论(0)
  • 2020-12-24 07:27

    Sometimes the m2e "maintained" eclipse project is out-of-sync with the actual project in POM (There are lots of reason for that). Assume you have using m2e 0.8 or later, right click on the project, under Maven, there are two entries that are usually useful. They are Update Dependencies and Update Project Configuration

    Have a try on them, wait a while after u clicked that for eclipse to update the project and build. Normally it solves similar problems.

    0 讨论(0)
  • 2020-12-24 07:29

    Updating maven project after importing it has fixed this issue for me:

    Right click on the project --> Maven --> Update project.

    0 讨论(0)
  • 2020-12-24 07:30

    sometimes maven update nor all above works. so check which import statement gives you error, then go particular lib file which is usually in c:user/ur-PC-NAME/.m2 get into package delete that .jar file.

    then in eclipse, right click on project > maven > update maven.

    0 讨论(0)
  • 2020-12-24 07:30

    For me Right click on the project --> Maven --> Update project with the "Force Update of Snapshots/Releases" checkmarked worked.

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