打包时报错repackage failed: Unable to find a single main class from the following candidates
解决方法:
因为多个类都有main方法,pom.xml加上一下配置:
<configuration>
<mainClass>com.wlg.admin.AdminApplication</mainClass>
</configuration>
如下所示:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.wlg.admin.AdminApplication</mainClass>
</configuration>
</plugin>
<!-- 跳过单元测试 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>