问题
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
回答1:
You can set manual reload and:
- Your IDE (i.e. Eclipse) will copy static resources to target directory so they will be updated transparently.
- 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>
回答2:
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.
回答3:
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.
来源:https://stackoverflow.com/questions/9758983/maven-jetty-do-not-reload-the-whole-application-when-modifying-only-static-fil