No spring.config.import property has been defined
时间: 2023-10-24 11:14:05 浏览: 40
The "spring.config.import" property is used to import external configuration files into a Spring Boot application. If you see the error message "No spring.config.import property has been defined," it means that the property is missing in your application.
To fix this error, you need to add the "spring.config.import" property to your application configuration file (usually application.properties or application.yml) and specify the location of the external configuration file(s) that you want to import. For example:
application.properties:
```
spring.config.import=classpath:config/application.yml
```
This will import the "application.yml" file located in the "config" directory of your application's classpath.
You can also specify multiple configuration files to import by separating them with commas:
```
spring.config.import=classpath:config/application.yml,file:/etc/myapp/config.properties
```
This will import both the "application.yml" file from the classpath and the "config.properties" file located in the "/etc/myapp" directory.
Make sure that the specified files exist in the specified locations and have the correct format and syntax.