SpringCloud
SpringCloud copied to clipboard
编译bug maven插件问题
BUG描述
清晰的BUG描述,有助于判断问题,请按如下步骤
1.说明操作的背景,使用了哪个模块什么功能?
- 由于
facade
模块继承了cloud
模块的spring-boot-maven-plugin
插件 - 又因为
facade
模块没有main方法所以该模块编译失败
2.怎么输入或操作的得到了什么结果?
-
cd facade && mvn install
编译失败[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.4.RELEASE:repackage (default) on project facade: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.1.4.RELEASE:repackage failed: Unable to find main class -> [Help 1]
3.预期结果与实际有什么差异?
理论应该编译成功
截图
环境 win10+jdk8,IDEA2021.3
排除spring-boot-maven-plugin
插件并使用maven-compiler-plugin
插件即可编译成功
facade
的 pom.xml
添加以下代码即可
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
感谢,mvn install的时候,facade确实有问题,不用spring-boot-maven-plugin插件,改用maven-compiler-plugin插件编译成功后,在根目录重新编译即可打包编译完成
收到!