<?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>