Packaged into a jar package through the maven packaging plugin
①Introduce the plug-in in the pom file
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
As shown in the picture:
②Package in idea
③How does the jar package work?
Find the location where the jar package is stored, open the cmd command line at this location, and enter in the command line, java -jar 包名
for example: