spring boot打成可執行jar

第一步 添加html

<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>

  第三步驟java

 

使用maven install 打包,將在target下生成項目jar包xxx-with-dependencies.jar複製出來,執行java -jar xxx-with-dependencies.jar便可運行。maven

 

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

相關文章
相關標籤/搜索