springboot打包可运行jar

添加SpringBoot自带插件

pom.xml中增加以下内容:

<build>
        <finalName>extract-plugin</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
命令行执行: mvn package

clean package spring-boot:repackage -Dmaven.test.skip=true

猜你喜欢

转载自blog.csdn.net/qq_31544285/article/details/86303092