偶然踩到的一个坑 如果你在子模块中一不小心配置了打包方式为pom <packaging>pom</packaging> 这时候子模块如果有mybatis plus就会直接找不到驱动
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
我还检查了半天maven依赖和SQL配置 发现是这个问题
这时候只要把子模块中的 <packaging>pom</packaging>去掉 留下父模块中的就行了
通过学习发现 pom 是最简单的打包类型,不像一个JAR,SAR,或者EAR,它生成的构件只是它本身。项目里没有java代码,也不执行任何代码,只是为了聚合工程或传递依赖用的。所以在需要执行代码的子模块中不能选择打包模式为pom