1、错误日志

23:27:06.725 [main] DEBUG org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - Application failed to start due to an exception
	org.springframework.cloud.commons.ConfigDataMissingEnvironmentPostProcessor$ImportException: No spring.config.import set
		at org.springframework.cloud.commons.ConfigDataMissingEnvironmentPostProcessor.postProcessEnvironment(ConfigDataMissingEnvironmentPostProcessor.java:82)
		at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:102)
		at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:87)
		at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
		at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
		at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
		at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
		at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85)
		at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66)
		at java.util.ArrayList.forEach(ArrayList.java:1259)
		at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
		at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114)
		at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65)
		at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:344)
		at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
		at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
		at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295)
		at com.example.mall.coupon.MallCouponApplication.main(MallCouponApplication.java:14)
	23:27:06.728 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - 

	***************************
	APPLICATION FAILED TO START
	***************************

	Description:

	No spring.config.import property has been defined

	Action:

	Add a spring.config.import=nacos: property to your configuration.
		If configuration is not required add spring.config.import=optional:nacos: instead.
		To disable this check, set spring.cloud.nacos.config.import-check.enabled=false.


2、解决方法

SpringCloud 2020.* 版本把 bootstrap 禁用了,导致在读取文件的时候读取不到而报错,将 bootstrap 重新导入进来就会生效了。
	
	<!-- 配置中心 -->
	<dependency>
		<groupId>com.alibaba.cloud</groupId>
		<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
	</dependency>
	<!-- 引入bootstrap,否则报错(如上错误日志) -->
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-bootstrap</artifactId>
		<version>3.1.1</version>
	</dependency>