Can hotswap be enabled using Spring boot ? When deploying Spring projects with Tomcat server setup separately hotswap seems enabled by default. But with Spring boot apps hotswap does not appear to be enabled. Is there a config can update hot swapping code into embedded Spring boot server ?
Asked
Active
Viewed 447 times
0
-
I might be missing something here, but if Tomcat is embedded in your application, what do you intend to hot swap? Surely whatever you plan on distribute will involve a new instance of Tomcat? – DaveyDaveDave Dec 18 '15 at 16:54
-
@DaveyDaveDave intend to hotswap changes as the app is being worked on, prior to distribution. – blue-sky Dec 18 '15 at 17:06
-
1you may like [spring boot 1.3 devtools](https://spring.io/blog/2015/06/17/devtools-in-spring-boot-1-3). for your hotswap – Thang Hoang Dec 19 '15 at 16:27
2 Answers
0
Use this dependencies
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
If you using Intellij IDEA right click to file you changed and click "Compile and Reload File"

Soykan
- 63
- 6
-1
Looking at effective pom of Spring boot this is included :
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.4.RELEASE</version>
</dependency>
Which enables hot swapping.
Should not need to configure a java agent to enable hot swapping.
Fix for me is to just start app in debug mode instead of 'run' mode. This forces re-compilation on src changes.

blue-sky
- 51,962
- 152
- 427
- 752