Hot Deploy and Live Reload
- Spring Boot
By default for Vaadin applications based on Spring Boot, live reload uses Spring Boot Developer Tools to automatically restart the server whenever classpath entries are updated.
The restart is faster than a manual restart, as it uses a customized class loader that reloads only the application’s own classes.
All Java code modifications are applied, including changes in the internal application logic, route modification (adding / removing / updating routes), and changes made to custom components (
The session is also preserved during the restart.
spring-boot-devtoolsis a dependency in the application’s
<dependencies> ... <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency> </dependencies>
Run the application using
mvn spring-boot:run(requires forking the JVM, which is the default mode) or via the
Open the application in the browser, make some Java code changes, recompile, and the browser reloads automatically.NoteDisable other Spring Developer Tools-related browser extensionsUninstall or disable any other browser extensions that refresh on Spring Developer Tools reload. As the Vaadin client also refreshes, having both active might lead to unexpected behavior.
If you notice spurious errors during server restart, such as
Could not navigate to … or
Error creating bean with name …, or you frequently see multiple restarts from a single code change, the problem may be file monitoring triggering the restart prematurely, before all updated files have been written.
The polling interval and quiet time can be configured in the
Higher values improve stability at the cost of a higher-latency restart cycle.
Modifications which rely on updated classpath dependencies require a full application restart.
The Vaadin client connects from the browser to the Spring Boot live reload server default port (35729). The port number to use can’t currently be changed in the client.