SpringBoot启动报错:Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded da

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

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

如图,springBoot 启动报错,这个报错的原因有几个,已知比如没有配置数据库连接等。
以下是我遇到的一个问题。
在主项目里建一个子项目 module,此时会在主项目的pom.xml文件中生成

<packaging>pom</packaging>
<modules>
    <module>s-01</module>
</modules>

把这几行删了就可以运行主项目了。
比较合理的解释是:当有子项目了,其实主项目里面src这一整块就可以直接删除了。因为不允许运行主项目的同时 也允许子项目。


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