maven doesn't find class

前端 未结 6 1969
遇见更好的自我
遇见更好的自我 2021-01-13 09:39

I\'ve inherited a huge maven java project and can\'t get it to compile.

mvn compile

Its telling me it can\'t find a class even though its r

6条回答
  •  野的像风
    2021-01-13 10:32

    First, double-check that you have the correct Maven coordinates in the file (groupId, artifactId and version). Look for typos.


    This could be caused by a corrupt local Maven repo. You can resolve it with these steps.

    Option 1:

    1. On your project, right-click: Maven > Update Project

    2. In the dialog, check the box: Force Update of Snapshots/Releases

    3. Click Ok

    Maven will perform a rebuild.

    If that doesn't solve your problem then move to option 2

    Option 2:

    1. Delete your local Maven repo, the .m2 directory on your computer

    On MS Windows

    either

    C:\Documents and Settings\\.m2
    
    c:\Users\\.m2
    

    On Mac/Linux

    ~/.m2
    

    Note, on your OS, you may need to configure your OS to show hidden files.

    1. Once .m2 directory is deleted, restart Eclipse

    2. On your project, right-click: Maven > Update Project

    This will resolve your issue.

提交回复
热议问题