在project 标签内,新增一下内容
<build>
<plugins>
<!--打包项目-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<mainClass>com.he.TestApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
然后 在eclipse 右键项目 Run As ---> maven build --> Goals 输入 package 打包