maven-jetty热部署

<?xml version="1.0" encoding="utf-8"?>  
<plugin>   
  <groupId>org.mortbay.jetty</groupId>    
  <artifactId>jetty-maven-plugin</artifactId>    
  <version>7.2.2.v20101205</version>    
  <configuration>   
    <webAppConfig>   
      <contextPath>/${project.artifactId}</contextPath>  
      <!-- 指定 root context 在这里指定为${project.artifactId} 即 jetty, 那么访问时就用http://localized:8080/jetty  访问, 如果指定梶为test 就用http://localized:8080/test访问,更多信息,请查看jetty 插件官方文档 -->   
    </webAppConfig>    
    <!-- 指定额外需要监控变化的文件或文件夹,主要用于热部署中的识别文件更新 -->    
    <scanTargetPatterns>   
      <scanTargetPattern>   
        <directory>src</directory>    
        <includes>   
          <include>**/*.java</include>    
          <include>**/*.properties</include>   
        </includes>   
      </scanTargetPattern>   
    </scanTargetPatterns>    
    <scanIntervalSeconds>0</scanIntervalSeconds>  
    <!-- 指定监控的扫描时间间隔,0为关闭jetty自身的热部署,主要是为了使用jrebel -->    
    <webAppSourceDirectory>${basedir}/src/main/webapp</webAppSourceDirectory>  
    <!-- 指定web页面的文件夹 -->   
  </configuration>   
</plugin>  
<!-- jerebel maven 插件,用于生成jrebel.xml -->  
<plugin>   
  <groupId>org.zeroturnaround</groupId>    
  <artifactId>javarebel-maven-plugin</artifactId>    
  <executions>   
    <execution>   
      <id>generate-rebel-xml</id>    
      <phase>process-resources</phase>    
      <goals>   
        <goal>generate</goal>   
      </goals>   
    </execution>   
  </executions>   
</plugin>
<span style="color: rgb(52, 52, 52); font-family: Tahoma; font-size: 14px; line-height: 24px; background-color: rgb(245, 245, 245);">javarebel:generate 生成rebel.xml文件</span>
<span style="color: rgb(52, 52, 52); font-family: Tahoma; font-size: 14px; line-height: 24px; background-color: rgb(245, 245, 245);"><span style="color: rgb(52, 52, 52); font-family: Tahoma; font-size: 14px; line-height: 24px; text-align: justify;">然后运行jetty:run或者</span><a target=_blank target="_blank" href="http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html#running-assembled-webapp-as-expanded-war" style="color: rgb(0, 51, 102); text-decoration: none; font-size: 13px; text-align: justify; font-family: Verdana, Helvetica, arial, freesans, clean, sans-serif; line-height: 16px;">jetty:run-exploded</a><span style="color: rgb(52, 52, 52); font-family: Tahoma; font-size: 14px; line-height: 24px; text-align: justify;">在VM argument下填入</span><span style="color: rgb(52, 52, 52); font-family: Tahoma; font-size: 14px; line-height: 24px; text-align: justify;">-noverify -javaagent:jrebel.jar的路径</span>
</span>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值