美文网首页
以Jar的方式部署 Spring boot 应用

以Jar的方式部署 Spring boot 应用

作者: lewiswon | 来源:发表于2018-06-04 19:34 被阅读40次
  1. 配置pom文件
···
  <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!--主要添加这一行配置-->
                    <executable>true</executable>
                </configuration>
            </plugin>
        </plugins>
    </build>
···

2.打包后,上传jar包到服务器相应目录,创建软链接到/etc/init.d/目录

 sudo ln -s /path store jar/application-name.jar /etc/init.d/application-name

3.启动应用

 sudo /etc/init.d/application-name start

4.设置开机启动

sudo chkconfig --add applicaion-name

相关文章

网友评论

      本文标题:以Jar的方式部署 Spring boot 应用

      本文链接:https://www.haomeiwen.com/subject/ddnysftx.html