使用springloaded
在maven中的<plugins>标签中加入springloadedjava
<plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <dependenices> <dependency> <groupId>org.springframework</groupId> <artifactId>springloaded</artifactId> <version>1.2.6RELEASE</version> </dependency> </dependenices> </plugin> </plugins>
命令行中切换到pom.xml文件夹下,使用maven启动spring bootspring
mvn spring-boot:run
还有一种方式,能够直接下载springloaded的jar包,而后在Run Configurations中设置VM argumentsmaven
-javaagent:D:\springloaded-1.2.6RELEASE.jar -noverify
使用spring-boot-devtools
在maven中增长依赖spring-boot
<dependenices> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency> </dependenices>