springboot项目打包遇到的问题

Dear 丶 2022-04-03 04:48 358阅读 0赞

1 Failed to configure a DataSource: ‘url’ attribute is not specified and no embedde

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2pzd2RfNTB4_size_16_color_FFFFFF_t_70

解决方法:

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

2018122015464147.png

2 IDEA编译报错“程序包XXX不存在”

错误原因是打包方式不对。

spring-boot maven打包,一般pom.xml文件里会添加



org.springframework.boot

spring-boot-maven-plugin

这样打的jar里会多一个目录BOOT-INF。(反编译工具打开)

20181220154841811

2.引起问题,程序包不存在。

3.解决办法,如果A子模块包依赖了B子模块包,在B子模块的pom文件,加入



org.springframework.boot

spring-boot-maven-plugin



true



目录BOOT-INF没有了

20181220154841832

发表评论

表情:
评论列表 (有 0 条评论,358人围观)

还没有评论,来说两句吧...

相关阅读