O'Reilly logo

Vaadin 7 Cookbook by Ondrej Kvasnovsky, Jaroslav Holan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Auto-reloading changes in Maven

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.

How to do it…

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required