Intellij+ JRebel +maven+jetty实现热部署

pom.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<scanIntervalSeconds>1</scanIntervalSeconds>
<reload>automatic</reload>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
<contextXml>${project.basedir}/src/main/resources/jetty-context.xml</contextXml>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<webAppSourceDirectory>${basedir}/WebRoot</webAppSourceDirectory>
<webAppConfig>
<contextPath>/absurd</contextPath>
</webAppConfig>
</configuration>
</plugin>

关于这部分的参数,详见链接

安装jrebel以及破解见
IDEA破解
jrebel破解

qq 20160909115113
qq 20160909115148

${project.basedir}/src/main/resources/jetty-context.xml

1
2
3
4
5
6
7
8
9

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Call name="setAttribute">
<Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
<Arg>.*/.*jsp-api-[^/]\.jar$|./.*jsp-[^/]\.jar$|./.*taglibs[^/]*\.jar$</Arg>
</Call>
</Configure>

ctrl+shift+f9编译当前class
ctrl+f9编译全部