spring boot打成可执行jar

第一步 添加

<packaging>jar</packaging>

第二步添加

<build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>com.hbase2Redis.Hbase2Redis</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

  第三步骤

 

使用maven install 打包,将在target下生成项目jar包xxx-with-dependencies.jar复制出来,执行java -jar xxx-with-dependencies.jar即可运行。

 

引用自https://www.cnblogs.com/sheeva/p/5032706.html

 

posted on 2017-11-20 16:05  Snowman-Nunu  阅读(289)  评论(0编辑  收藏  举报

导航