问题
公共包执行install时失败,提示:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.2.RELEASE:repackage (repackage) on project common: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.3.2.RELEASE:repackage failed: Unable to find main class
原因: 找不到主类(这个包是公共包,不需要main class)
解决方案
在pom文件中,配置打包插件,让其不包含主类。
<build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><mainClass>none</mainClass><!-- 取消查找本项目下的Main方法:为了解决Unable to find main class的问题 --><classifier>execute</classifier> <!-- 为了解决依赖模块找不到此模块中的类或属性 --></configuration><executions><execution><goals><goal>repackage</goal></goals></execution></executions></plugin></plugins></build>