We need to do many changes in the code during development and it is really annoying when we have to restart the server after every little change.
We will explore ways of enabling auto-reloading in a Maven project when we use the Jetty web server. Why Jetty? It is because Jetty is lightweight and a quick container that is just perfect for application development.
We add the
scanIntervalSeconds configuration element that defines the number of seconds after Jetty checks for the changes in the classpath:
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <configuration> <scanIntervalSeconds>2</scanIntervalSeconds> </configuration> </plugin>
Alternatively, we just define ...