springboot 多个maven模块打包异常:Unable to find main class
原因:在父工程中加入了springboot的maven插件,即:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
此插件会进行repackage:
util这个模块只是一个普通的maven模块,但是由于父工程引用了springboot的maven插件,所以进行了repackage。
子模块如何引入父模块
出现不去本地进行找包,直接去私服中找包。
默认值为../pom.xml
查找顺序:relativePath元素中的地址–本地仓库–远程仓库
设定一个空值将始终从仓库中获取,不从本地路径获取。
如
<relativePath/>
开发遇到的问题:springboot问题:Unable to find main class
原文:https://www.cnblogs.com/cxy2020/p/14098107.html