首页 > 编程语言 > 详细

springboot 热部署

时间:2019-01-19 15:06:01      阅读:184      评论:0      收藏:0      [点我收藏+]

作用:不重启服务器编译/部署项目

1. 添加依赖

<!-- 热部署 -->
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency>

2. 修改pom.xml配置  (添加configuration  )

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                <fork>true</fork>
                </configuration>
            </plugin>
        </plugins>
</build>

3. 重启服务

 

4. 便捷取消热部署

  在main方法中添加

//此设置一定要在SpringApplication.run(DemoApplication.class, args); 前面进行设置
System.setProperty("spring.devtools.restart.enabled","false");

 

springboot 热部署

原文:https://www.cnblogs.com/dztHome/p/10291679.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!