Domanda

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

È stato utile?

Soluzione

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>

Altri suggerimenti

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.

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top