No Spring. Config. Import Property Has Been Defined
While Creating Spring Boot Cloud Config Application Getting Below Error. Any Help on This? No Spring. Config. Import Property Has Been Defined Action: Add a...
While creating Spring Boot cloud config application getting below error. Any help on this?
No spring.config.import property has been defined
Action:
Add a spring.config.import=configserver: property to your configuration.
If configuration is not required add spring.config.import=optional:configserver: instead.
To disable this check, set spring.cloud.config.enabled=false or
spring.cloud.config.import-check.enabled=false.
12 Answers
Solution: Add the below dependency in the pom.xml file:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
That resolved my issue.
You're getting this error because you're using a new version of Spring Boot and Spring Cloud, but you're trying to configure it in the old way.
Must Read
The Reason
Spring Cloud Config Client has changed and technically bootstrap.properties and bootstrap.yml files are deprecated.