在pom.xml文件中配置Jetty插件的参数:scanIntervalSecondshtml
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <configuration>
<!--扫描项目变动的时间间隔,默认为0不扫描--> <scanIntervalSeconds>1</scanIntervalSeconds> <stopPort>8080</stopPort> <stopKey>bar</stopKey> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>8080</port> <maxIdleTime>60000</maxIdleTime> </connector> </connectors> <webAppConfig> <contextPath>/</contextPath> </webAppConfig> </configuration> </plugin>
而后使用正常运行或者Debug运行均可以,不过期间应该在3秒之内会发现而后重启。web
若是使用Eclipse的Jetty插件,很遗憾,没找到解决方法。eclipse
若是使用Eclipse的Tomcat插件,这个默认支持热部署的。时间也是3秒左右,不过好像静态文件支持不太好。maven
若是使用Maven的Tomcat插件,好像不行,没试过。spa
参考:插件
http://www.cnblogs.com/yanyd/p/5767278.html(以上内容转自此篇文章)code