2

I came across a video on youtube ( https://www.youtube.com/watch?v=GTrNkhVnJBU ) where it demos Spring Loaded.

I'm trying to duplicate the same behavior but am still unsuccessful so far.

What I'm using:

Spring Tool Suite 3.7.2 Spring Boot 1.3.2-RELEASE Spring loaded 1.2.5-RELEASE Maven version 3.1.0 JDK 1.8.0_71

I tried the same thing as the guy does in the video (except for the versions being more up to date of course) but it doesn't work.

I also tried the "maven plugin" way as described in the spring docs here -> https://docs.spring.io/spring-boot/docs/current/reference/html/howto-hotswapping.html#howto-reload-springloaded-maven But that also did not work.

I tried changing the versions of spring loaded to 1.2.0 (docs use that version) but that didn't do anything either.

I ran the app in STS itself, and also tried mvn spring-boot:run from command line, but both simply don't get the desired result.

When using mvn spring-boot:run I see that it is attaching the agent:

[INFO] Attaching agents: [C:\Users\ron.m2\repository\org\springframework\springloaded\1.2.5.RELEASE\springloaded-1.2.5.RELEASE.jar]

But changing RequestMappings or method signatures do not get picked up by spring loaded and thus the change is not reflected.

I'm a little out of ideas why I can't get this to work and any help would be greatly appreciated.

4

2 回答 2

4

弹簧加载还不支持弹簧 4.2。见https://github.com/spring-projects/spring-loaded/issues/139

所以你要么坚持使用DevTools,它肯定会加快开发过程(尽管不如 spring-loaded 快),使用 JRebel(支持最新的 spring 版本)或降级到 spring 4.1。

于 2016-01-26T19:38:35.970 回答
0

作为替代方案,您还可以尝试 Spring Boot Devtools 的自动重启功能:https ://spring.io/blog/2015/06/17/devtools-in-spring-boot-1-3 。它仅重新启动应用程序,并且比重新启动整个 JVM 快得多。虽然您正在丢失应用程序状态,但它可能是一种替代方法。

于 2016-01-27T10:04:47.277 回答