springboot maven 多模块项目打包的时候某个被依赖的模块报错
[ERROR] Failed to execute goal :spring-boot-maven-plugin:2.1.:
repackage (repackage) on project **-client: Execution repackage of goal :spring-boot-maven-plugin:2.1.:repackage failed:
Unable to find main class -> [Help 1]
这个被依赖的**-client模块并不需要有main类,解决方法是修改父
原来的父中的标签内容为
<build>
<plugins>
<plugin>
<groupId></groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
将父中的标签内容改为
<build>
<plugins>
<plugin>
<groupId></groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<fork>true</fork>
<verbose>true</verbose>
<encoding>UTF-8</encoding>
<meminitial>256m</meminitial>
<maxmem>1024m</maxmem>
</configuration>
</plugin>
</plugins>
</build>
原因可以参考springboot官网
/spring-boot/docs/current/reference/html/#build-tool-plugins-maven-packaging
Once spring-boot-maven-plugin has been included in your ,
it automatically tries to rewrite archives to make them executable by using the spring-boot:repackage goal.