<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.2</version>
<configuration>
<!-- fork表示是否执行-->
<fork>true</fork>
<mainClass>com.example.Application</mainClass>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<!-- 表示执行repackage操作的时候使用该插件-->
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
- 操作步骤,引入插件,配置启动类
- maven clean
- maven package