浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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>中加入:

Xml代码  收藏代码
  1. <plugin>    
  2.          <groupId>org.mortbay.jetty</groupId>    
  3.          <artifactId>maven-jetty-plugin</artifactId>    
  4.          <version>${jetty.version}</version>  
  5.          <configuration>    
  6.              <contextPath>/shiro</contextPath>    
  7.              <connectors>    
  8.                  <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">    
  9.                      <port>8080</port>    
  10.                  </connector>    
  11.              </connectors>    
  12.              <reload>automatic</reload>  
  13.              <scanIntervalSeconds>10</scanIntervalSeconds>    
  14.          </configuration>    
  15. </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

posted on 2012-01-25 20:36  lexus  阅读(210)  评论(0)    收藏  举报