http://gongstring.iteye.com/blog/455756
http://www.iteye.com/topic/207653
http://www.iteye.com/topic/648358
maven权威指南中英文 ,甚好
http://xizhenyin.iteye.com/blog/609409
在pom.xml文件中的<plugins>中加入:
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>${jetty.version}</version>
- <configuration>
- <contextPath>/shiro</contextPath>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8080</port>
- </connector>
- </connectors>
- <reload>automatic</reload>
- <scanIntervalSeconds>10</scanIntervalSeconds>
- </configuration>
- </plugin>
使用命令行时 mvn jetty:run -Djetty.reload=automatic -Djetty.scanIntervalSeconds=10
"Manual Reloading"
As of Jetty 6.2.0pre0 a new feature to control webapp redeployment will be available.
The configuration parameter is: <reload>[manual|automatic]</reload>
When set to manual, no automatic scanning and redeployment of the webapp is done. Rather, the user can control when the webapp is reloaded by tapping the carriage return key. Set to automatic the scanning and automatic redeployment is performed at intervals controlled by the scanIntervalSeconds parameter. The choice of reloading paradigm can also be configured on the command line by use of the -Djetty.reload system parameter.
For example: "mvn -Djetty.reload=manual jetty:run" would force manual reloading, regardless of what is configured in the project pom. Similarly: "mvn -Djetty.reload=automatic -Djetty.scanIntervalSeconds=10 jetty:run" will force automatic background reloading with a sweep every 10 seconds, regardless of the configuration in the project pom.
mvn clean compile package install -Djetty.reload=automatic jetty:run