fbiville
fbiville

Reputation: 8950

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

Upvotes: 1

Views: 5199

Answers (4)

embuc
embuc

Reputation: 688

For newer versions of Jetty plugin (>=11):

...
<configuration>                 
    <!-- to redeploy hit enter in the console-->
    <scan>0</scan>      
</configuration>

Upvotes: 0

chrismarx
chrismarx

Reputation: 12545

Set scanIntervalSeconds to -1

<plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <configuration>

          <scanIntervalSeconds>10</scanIntervalSeconds>

from http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin :

scanIntervalSeconds Optional. The pause in seconds between sweeps of the webapp to check for changes and automatically hot redeploy if any are detected. By default this is 0, which disables hot deployment scanning. A number greater than 0 enables it.

Upvotes: 0

yohann.martineau
yohann.martineau

Reputation: 1643

I understand your need about CSS files or maybe html files, but take care, JSP files are actually Servlets. And a Servlet has to be undeployed in a way or another before reloading it.

Upvotes: 0

amuniz
amuniz

Reputation: 3342

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>

Upvotes: 3

Related Questions