I am trying to write a simple RESTful service using Spring Boot. However, there is an error message I am not able to solve. I have been researching and it looks like it is a
Delete the springframework folder in repository, then press Alt + F5 and update the project (force update snapshot).
C:\Users\xxxx\.m2\repository\org\springframework
I changed the boot-starter-parent configuration which was runnig version 2.0.0 to 1.4.0 and I was able to run the java application and got rid of this error
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version> <!-- changed it to version 1.4.0 from 2.0.0-->
<relativePath/> <!-- lookup parent from repository -->
</parent>
changed the boot-starter-parent version from 1.5.1.RELEASE to 1.4.0.RELEASE.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.2.RELEASE</version>
</parent>
I had same problem with Spring boot 2.1.9.RELEASE
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
Added pom dependency eliminated this exception:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.2.0.RELEASE</version>
</dependency>
EDIT - better approach.
Also clean up of maven repository with spring dependencies resolved problem for me, there were not need to add spring-core 5.2.0.RELEASE in pom. Seems that when I had many versions of spring in repo some problem occurs. Also before again resolve dependencies dont forget clean project.
rm -rf ~/.m2/repository/org/springframework/
Spring boot is running -
<spring.version>4.3.2.RELEASE</spring.version>
For -
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.4.0.RELEASE</version>
</dependency>
While you are importing -
<springframework.version>4.3.0.RELEASE</springframework.version>
You can confirm on the master pom -
https://github.com/spring-projects/spring-boot/blob/v1.4.0.RELEASE/spring-boot-dependencies/pom.xml
Can you update the spring version in your pom? Or deal with managing maven dependencies