0

I created a spring boot maven project. Everything was fine until I added spring-boot-starter-data-mongodb to the dependencies like below

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-mongodb</artifactId>
    </dependency>

Intellij-idea complains

Failed to read artifact descriptor for org.springframework.boot:spring-boot-starter-data-mongodb:jar:2.3.2.RELEASE

and

Dependency 'org.springframework.boot:spring-boot-starter-data-mongodb:2.3.2.RELEASE' not found

Could anyone tell me how to solve this?

Jia Li
  • 488
  • 2
  • 8
  • Does this question https://stackoverflow.com/questions/6642146/maven-failed-to-read-artifact-descriptor solves your problem? – Deepak Patankar Aug 21 '20 at 13:33
  • 1
    Try this: https://start.spring.io/ -> Select the Dependency (NoSQL Spring Data MongoDB) -> Generate the project. The generated ZIP file can be imported (Open or Import) into your IDE. Build and run. – prasad_ Aug 21 '20 at 13:40
  • Check the pom.xml from the generated project ZIP file for the correct dependencies. – prasad_ Aug 21 '20 at 13:52
  • have you tried `mvn clean install` in terminal – varman Aug 21 '20 at 13:57
  • Thanks for all the replies. This seems something to do with the built-in Maven in the Intellij-idea. After I downloaded and installed the latest Maven 3.6.3 and set the path in the System Path, the project starts to recognise the mongodb. – Jia Li Aug 21 '20 at 14:58
  • You also have other option in intellij, `invalidate caches and restart` – Dinesh Dontha Aug 21 '20 at 21:09

1 Answers1

1

enter image description here

Reloading Project solved the issue for me.