jetty 热部署

来源:互联网 发布:按键小精灵查看源码 编辑:程序博客网 时间:2024/04/28 00:53
<?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>
javarebel:generate 生成rebel.xml文件
然后运行jetty:run或者jetty:run-exploded在VM argument下填入-noverify -javaagent:jrebel.jar的路径


0 0
原创粉丝点击