spring-boot maven打包可执行jar

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_38362455/article/details/81162562

一.
pom.xml中加入依赖

  <plugin>
       <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <!--<executions>-->
            <!--<execution>-->
                <!--<goals>-->
                    <!--<goal>repackage</goal>-->
                <!--</goals>-->
            <!--</execution>-->
        <!--</executions>-->
  </plugin>

注意pom中packaging 是否为jar类型
这里写图片描述

二.下面配置打包
这里写图片描述
这里写图片描述

这里写图片描述

三.
然后使用maven 打包成jar
点击install 开始打包
这里写图片描述
成功如下:
这里写图片描述
这里写图片描述

打包完成下面用idea 执行下
这里写图片描述
这里写图片描述
这里写图片描述

猜你喜欢

转载自blog.csdn.net/weixin_38362455/article/details/81162562