maven插件spring-boot-maven-plugin

spring-boot-maven-plugin是一个springboot maven插件,能够把代码和依赖包打成一个胖jar
<plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        <configuration>
                            <mainClass>org.example.master.Application</mainClass>
                            <!--如下配置,使Spring Boot使用PropertiesLauncher,可以實現在命令行指定啟動類-->
                            <layout>ZIP</layout>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

使用如下命令进行打包

mvn clean install -Dmaven.test.skip=true

参考:https://www.cnblogs.com/jpfss/p/11098740.html

原文地址:https://www.cnblogs.com/wangbin2188/p/14713809.html