SpringBoot Maven 打包(可运行)

示例工程:SpringBoot + Maven

1.使用SpringBoot自带插件

pom.xml文件中添加如下代码:

(代码不设置行号,方便后续拷贝。)

<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!-- 工程主入口--> <mainClass>com.gannalyo.plugin.MySampleMavenPackagePluginApplication</mainClass> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpsyyz.html