一、Unable to find main class
1.1、问题描述
最近在写Spring Boot2.x的项目重构,之前写的demo里面有很多地方重复,正好现在有时间就把这些公共组件做一个抽取,抽取出了一个公共模块,但是在执行maven clean install指令时,报错Unable to find main class,如下所示:
1.2、解决
公共模块的pom.xml文件中添加如下配置:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
1.3、效果
1.4、参考
https://blog.youkuaiyun.com/weixin_43888891/article/details/130487516