现象:Unable to find main class
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.4.RELEASE:repackage (default) on project spring-cloud-kubeedge-core: Execution default of goal org.springframework.boot:s
pring-boot-maven-plugin:2.0.4.RELEASE:repackage failed: Unable to find main class
改进:
pom文件中加入:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中 -->
</goals>
<phase>none</phase>
<!--可以生成不含依赖包的不可执行Jar包 -->
<configuration> <classifier>exec</classifier> </configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
这里的重点是<phase>none</phase>