spring boot的配置文件名由application改为bootstrap后无法读取的问题?
1. 在pom文件增加如下引入,引入新的jar依赖!!!
<!--需要引入该jar才能使bootstrap配置文件生效-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>
如果引入后还是找不到jar,很可能需要增加一个版本号,如下:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
<version>2.0.2.release</version>
</dependency>
2. 在引入了这个配置后,还是有可能会报如下的错误:
Invocation of init method failed; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSource
Properties$DataSourceBeanCreationException: Failed to determine a suitable driver clas
2020-03-02 16:23:50.514 I