关于Spring Boot 启动报错的问题

关于Spring Boot 启动报错的问题

最近正在学习springboot ,写了一个小项目,结果发现这个项目复制到其他文件夹,传给别人都不能运行。显示错误。
报错信息:

om.zaxxer.hikari.HikariDataSource]: 
Factory method 'dataSource' threw exception; nested exception is 
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: 
Failed to determine a suitable driver class

找了很多博客,没有解决,最后我发现在配置文件中,数据全是灰色的。我知道了,配置信息没有加载进来。
所以
在pom.xml里面的build 标签下加入:

       <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.yml</include>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>

总算解决了 。呜呜呜
之前也灭有这样设置过呀。


版权声明:本文为lemon_kui原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。