启动Spring boot项目报错

‘spring.datasource.url’ is not specified and no embedded datasource could be auto-configured.

项目打包在另外一台机器上启动,报这个错误,但我确定我代码是正确的,且我需要使用数据库地址,网上清一色的说是不需要数据库地址的时候@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})

但是!!!这样注解并没有解决我的问题!!!

正确的解决方式是:
重新建一个项目,把代码copy一份再启动,解决问题。
目前还没有找到其他解决方案。如果有的话,麻烦告知一下。

猜你喜欢

转载自blog.csdn.net/codeydj/article/details/88082285