Consider a default webapp configuration in Maven (for the test case I used struts2-blank-archetype from https://repository.apache.org/content/groups/public/archetype-catalog.xml ).
This archetype comes with maven jetty plugin's version 6. With the configuration below, if I change a jsp under /src/main/webapp/WEB-INF/ and save it, refreshing the browser will show these changes.
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.21</version> <configuration> <scanIntervalSeconds>10</scanIntervalSeconds> </configuration> </plugin>
(notice that one doesn't even need to put the scantarget element, as we don't want a complete container reload when you just change a jsp).
However, the exact same configuration of version 8 of the plugin (see below) does not work. If I change the same jsp, refreshing the browser will show the old JSP contents. Only by stopping and starting the server will I see the changes.
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.7.v20120910</version> <configuration> <scanIntervalSeconds>10</scanIntervalSeconds> </configuration> </plugin>
What is wrong with this configuration, and what configuration would produce the same results in version 8 (ie, auto-refreshing the jsp contents without restarting the server)?
EDIT: Here's a 2 minute test you can try:
- Create archetype struts2-archetype-convention ("mvn archetype:generate", 308, package war).
- Edit the pom and set the jetty plugin configuration to the one listed above (version 6)
- mvn jetty:run
- Open the browser on "http://localhost:8080"
- See "Languages" on the page
- Edit /src/main/webapp/WEB-INF/content/hello.jsp - change "Languages" for something else. Save.
- Refresh the browser and see the change.
- Repeat the steps. On step 2, change the artifactId and version to the ones listed above (version 8)
- Confirm the webpage does not change upon refresh after you perform the change in the JSP.