Successful build in Maven still showing errors in Eclipse

前端 未结 18 1727
猫巷女王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:16

    You've a library (quartz-1.5.2.jar) that's reference to your m2 local repository which doesn't exist if you just remove the quartz from your build path and update your dependencies internally(in eclipse) that would solve the problem

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

    You should try mvn eclipse:eclipse

    And then make sure the M2_REPO variable is point to your local repository.

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

    In my case, eclipse starts to show all errors after I changed some versions of dependencies in pom.xml, however the command line mvn clean install build successfully

    1. I deleted folders of the dependencies I changed manually from the .m2 repositories (in my case everything under org.apache.beam), because I also has corrupted dependency issues.
    2. mvn clean build the project, this downloaded the dependencies again
    3. right click project: maven -> update project
    4. delete the project from eclipse (but not from disk) and reimport (this actually left me with 1 error still, then i delete and reimported again)
    0 讨论(0)
  • 2020-12-24 07:20

    In my case there were also problems with Java build path like the following: "Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment." Fixing this resolved compilation errors.

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

    If you don't see any error in Eclipse project but it keeps showing the red icon on your project name. Try mvn eclipse:eclipse.

    Then select all projects in Eclipse, Right click > Maven > Update projects

    Hope it helps.

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

    That often happens when the m2eclipse hasn't updated the build path to correspond to what a modified POM file says. There's an entry in the Maven context menu to update the Configuration.

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