The Jetty Maven plugin with the
scanIntervalSeconds configuration set to a positive value performs complete application restart when the given number of seconds have elapsed since the last Java change.
<plugins> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.4.36.v20210114</version> <configuration> <scanIntervalSeconds>2</scanIntervalSeconds> </configuration> </plugin> <!-- more plugins --> </plugins>
Recommended minimum version
Jetty Maven Plugin versions before
Since the plugin performs a full server restart, all Java changes are picked up.
This includes modifications to server startup listeners, as well as changes to code that connects front-end and back-end components, such as adding a new
LitTemplate class, or adding a new CSS import and using it in Java via the
However, the session is not preserved during the restart.