zoukankan      html  css  js  c++  java
  • Jetty插件实现热部署(开发时修改文件自动重启Jetty)

    在pom.xml文件中配置Jetty插件的参数:scanIntervalSeconds

                <plugin>
                    <groupId>org.mortbay.jetty</groupId>
                    <artifactId>jetty-maven-plugin</artifactId>
                    <configuration>
                <!--扫描项目变更的时间间隔,默认为0不扫描--> <scanIntervalSeconds>1</scanIntervalSeconds> <stopPort>8080</stopPort> <stopKey>bar</stopKey> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>8080</port> <maxIdleTime>60000</maxIdleTime> </connector> </connectors> <webAppConfig> <contextPath>/</contextPath> </webAppConfig> </configuration> </plugin>

    然后使用正常运行或者Debug运行都可以,不过时间应该在3秒以内会发现然后重启。

    如果使用Eclipse的Jetty插件,很遗憾,没找到解决方法。

    如果使用Eclipse的Tomcat插件,这个默认支持热部署的。时间也是3秒左右,不过好像静态文件支持不太好。

    如果使用Maven的Tomcat插件,好像不行,没试过。

    参考:

    http://www.cnblogs.com/yanyd/p/5767278.html(以上内容转自此篇文章)

  • 相关阅读:
    贝叶斯定理
    用matplotlib统计数据并画图
    词云图
    一行python代码能写出啥?
    用python生成二维码
    18个python的高效编程技巧
    django简介
    vue点击变色
    selenium破解人人登陆验证码
    selenium请求豆瓣网
  • 原文地址:https://www.cnblogs.com/EasonJim/p/7821159.html
Copyright © 2011-2022 走看看