Search code examples
javamavenjettymaven-jetty-pluginvs-web-application-project

Maven Jetty - do not reload the whole application when modifying only static files


Maven Jetty plugin is very nice (I'm using version 6.1.26). The only annoying thing concerns static files' modifications. My web application uses Spring, follows the standard webapp Maven layout and I basically do not want the whole context to be reloaded whenever I change a JSP or a CSS file.

I checked the configuration settings, but didn't find anything about this.

Any idea ?

Thanks in advance !

Rolf


Solution

  • You can set manual reload and:

    1. Your IDE (i.e. Eclipse) will copy static resources to target directory so they will be updated transparently.
    2. When you make changes in Java classes you only need to hit enter in the jetty process to reload.

    To set manual reloading:

    <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <version>6.1.26</version>
        <configuration>
            <reload>manual</reload>
        </configuration>
    </plugin>