项目总结39:Springboot打jar包并本地运行

 平时一般想打包都是war包,这次需要jar包;Springboot项目打jar包方法如下:

pom文件(省略不相关依赖)

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <artifactId>maintenance</artifactId>
    <name>maintenance</name>-->
    <description>Demo project for Spring Boot</description>
  <!--打包方式:jar-->
    <packaging>jar</packaging>


    <build>
        <finalName>maintain</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
            <!--项目启动类-->             
            <mainClass>com.hzsun.shr.web.maintenance.MaintenanceApplication</mainClass> </configuration> </plugin> </plugins> </build> </project>

 

 在jar文件所在目录 启动jar包

 

posted on 2019-11-04 17:48  我不吃番茄  阅读(1215)  评论(0编辑  收藏  举报