Springloaded Spring Boot热重载

时间:2017-06-22 16:32:08

标签: spring eclipse spring-boot

我在项目中添加了springloaded as dependency

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>springloaded</artifactId>
    <version>1.2.7.RELEASE</version>
</dependency>

我设置为VM参数:

-javaagent:C:\Users\myuser\.m2\repository\org\springframework\springloaded\1.2.7.RELEASE\springloaded-1.2.7.RELEASE.jar -noverify

热重装仍然无效。我做错了什么/错过了什么?

1 个答案:

答案 0 :(得分:0)

根据代码,我假设您尝试将SpringloadedSpring Boot应用一起使用。要使用Spring Boot应用程序启用此功能,您应该将其作为对spring-boot-maven-plugin

的依赖项包含在内
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>springloaded</artifactId>
        <version>1.2.7.RELEASE</version>
    </dependency>
</dependencies>

有关hotswapping的更多文档https://docs.spring.io/spring-boot/docs/current/reference/html/howto-hotswapping.html#howto-hotswapping

https://docs.spring.io/spring-boot/docs/current/reference/html/howto-hotswapping.html#howto-reload-springloaded-maven