水莹儿 发表于 2017-2-27 08:57:08

eclipse maven jetty 实现热部署项目(转)

  pom.xml文件中设置scanIntervalSeconds不为0,如下设置为3秒
<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>8.1.13.v20130916</version>
    <configuration>
        <webAppConfig>
            <contextPath>${webapp.path}</contextPath>
            <defaultsDescriptor>webdefault.xml</defaultsDescriptor>
        </webAppConfig>
        <connectors>
            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                <port>${webapp.port}</port>
                <maxIdleTime>60000</maxIdleTime>
            </connector>
        </connectors>
        <reload>automatic</reload>
        <scanIntervalSeconds>3</scanIntervalSeconds>
        <stopPort>${webapp.stopPort}</stopPort>
        <stopKey>${webapp.stopKey}</stopKey>
        <!-- stopPort>${webapp.stopPort}</stopPort -->
        <systemProperties>
            <systemProperty>
                <name>org.mortbay.util.URI.charset</name>
                <value>UTF-8</value>
            </systemProperty>
        </systemProperties>
        <jvmArgs>-Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m
            -Dfile.encoding=UTF-8</jvmArgs>
    </configuration>
    <executions>
        <execution>
            <id>start-jetty</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>run</goal>
            </goals>
            <configuration>
                <scanIntervalSeconds>3</scanIntervalSeconds>
                <daemon>true</daemon>
            </configuration>
        </execution>
        <execution>
            <id>stop-jetty</id>
            <phase>post-integration-test</phase>
            <goals>
                <goal>stop</goal>
            </goals>
        </execution>
    </executions>
</plugin>
页: [1]
查看完整版本: eclipse maven jetty 实现热部署项目(转)