[Solved] IDEA Maven Error: Cannot resolve xxx & Maven Dependencies Error

Prerequisites

Premise: Make sure the dependencies in Maven are correct, Don’t make mistakes such as missing letters.
If you are worried, you can go to the official website to search, and copy and paste it again.
Official website link: https://mvnrepository.com/

scene

Importing a new project,or other reasons,maven refresh is also useless, it reports error as show below:

Solution:

1. First, Clear the cache, Click and restart IDEA.

2. Close IDEA, Open the project folder

Find .idea in the project, delete workspace.xml

3. Re-open IDEA, find Maven on the right

Double-click clean

Wait for the console to appear BUILD SUCCESS

Find install under maven again, Double-click it and the download log shown below will appear.

Wait it over, and BUILD SUCCESS will appear:

Click the Reload button in the Maven component again, wait for the bottom progress bar to end

4. Solve the Dependencis report in Maven

First, Open the file pom.xml

Then delete the content in the tag dependencies [recommended to use Ctrl + x]

Click the Reload button in the Maven component again, wait for the bottom progress bar to finish. [dependencies disappears at this time]

Then in pom.xml, use the shortcut key Ctrl + z to return

(If you are using Ctrl + x , you can use Ctrl + v to paste)

Let the dependencies content appear again,return to the previous state.

The last step: click the Reload button in the Maven component again, wait for the bottom progress bar to finish. [At this time,dependencies appears and no longer reports an error]

Final effect:

Finally, it is solved.

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *