jetty服务器运行问题
发布网友
发布时间:2023-12-21 03:47
我来回答
共1个回答
热心网友
时间:2024-01-15 17:37
你好,可以进行热部署,下面是带面,请参考
<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>
注意:pom.xml文件中设置scanIntervalSeconds不为0,如上设置为3秒
天互数据 为您解答,希望能帮到你