intellij +maven + jetty实现热部署

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hqqqqqqq555/article/details/73848933

简单来说,就是在pom配置文件jetty配置中添加scanIntervalSeconds。
大致样式:

    <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>7.6.5.v20120716</version>

        <configuration>
          <scanIntervalSeconds>1</scanIntervalSeconds>
          <stopKey>foo</stopKey>
          <stopPort>9999</stopPort>
        </configuration>
    </plugin>

官方解释:
http://www.eclipse.org/jetty/documentation/9.4.x/jetty-maven-plugin.html

scanIntervalSeconds
The pause in seconds between sweeps of the webapp to check for changes and automatically hot redeploy if any are detected. By default this is 0, which disables hot deployment scanning. A number greater than 0 enables it.

默认为0的时候是禁用热部署的,取个比0大的值即可。

这样设置后,在应用运行的过程中,只需编译修改过的文件,就可以实现热部署啦!

猜你喜欢

转载自blog.csdn.net/hqqqqqqq555/article/details/73848933