The Spring project is packaged into a jar package

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

insert image description here
③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 包名
jar package storage location
for example:insert image description here

Guess you like

Origin blog.csdn.net/qq_44255741/article/details/129659017