码迷,mamicode.com
首页 > 编程语言 > 详细

springboot 热部署

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

标签:maven   xml配置   optional   项目   color   tar   enable   conf   设置   

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

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 热部署

标签:maven   xml配置   optional   项目   color   tar   enable   conf   设置   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!