在给之前做的SpringCloud论坛项目打包时出现如题报错,即
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.13.RELEASE:repackage (repackage) on project user-api-service: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.13.RELEASE:repackage failed: Unable to find main class -> [Help 1]
解决办法
修改那些没有main启动类的子模块的pom.xml
将
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
修改为
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>repackage</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
您可以选择一种方式赞助本站
支付宝扫一扫赞助
微信钱包扫描赞助
赏