版权声明:本文为博主原创文章,转载请注明出处http://blog.youkuaiyun.com/saytime https://blog.youkuaiyun.com/saytime/article/details/74781701 </div>
<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-f57960eb32.css">
<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-f57960eb32.css">
<div class="htmledit_views" id="content_views">
每次修改代码都要重启服务器的痛,别说你不懂。
一、环境
- IntelliJ IDEA 2017.1.4 x64
二、SpringBoot 配置
-
<dependency>
-
<groupId>org.springframework.boot
</groupId>
-
<artifactId>spring-boot-devtools
</artifactId>
-
<optional>true
</optional>
-
</dependency>
-
<build>
-
<plugins>
-
<plugin>
-
<groupId>org.springframework.boot
</groupId>
-
<artifactId>spring-boot-maven-plugin
</artifactId>
-
<configuration>
-
<fork>true
</fork>
-
</configuration>
-
</plugin>
-
</plugins>
-
</build>
三、IDEA 设置
- 自动build
- Register配置
Ctrl+Shift+Alt+/ => Register => 找到并勾选compiler.automake.allow.when.app.running => IDEA重启
四、测试
确认IDEA重启后,debug启动SpringBoot项目,修改第一篇文章的HelloController
-
@
RequestMapping
(value =
"sayhello"
,
method
=
RequestMethod
.
GET
)
-
public
String sayhello(){
-
return
"Hello SpringBoot !";
-
}
"Hello SpringBoot !"; == > "Hello SpringBoot 2 !";
测试成功