300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > spring-boot-maven-plugin:2.3.2.RELEASE:repackage failed: Unable to find main class

spring-boot-maven-plugin:2.3.2.RELEASE:repackage failed: Unable to find main class

时间:2022-07-15 01:01:52

相关推荐

spring-boot-maven-plugin:2.3.2.RELEASE:repackage failed: Unable to find main class

问题

公共包执行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>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。