spring boot 在idea中实现热部署

来源:互联网 发布:汉族战斗民族知乎 编辑:程序博客网 时间:2024/06/06 16:26

使用工具:spring-boot-devtools

原理:监听class文件变动,据说是用了两个ClassLoader加快重启速度。

maven

<dependency>    <groupId>org.springframework.boot</groupId>    <artifactId>spring-boot-devtools</artifactId>    <optional>true</optional></dependency><plugin>    <groupId>org.springframework.boot</groupId>    <artifactId>spring-boot-maven-plugin</artifactId>    <configuration>        <!--//热部署,必须-->        <fork>true</fork>    </configuration></plugin>

idea设置:

  • CTRL + SHIFT + A –> 查找make project automatically –> 选中make project automatically

  • CTRL + SHIFT + A –> 查找Registry –> 找到并勾选compiler.automake.allow.when.app.running

OK

参考:http://412887952-qq-com.iteye.com/blog/2300313

原创粉丝点击