使用jetty服务器进行热部署

时间:2013-05-23 12:12:43

标签: jetty jetty-8 runjettyrun

我在我的应用程序中使用独立的jetty服务器。我想为jar做一个热部署。当我浏览网页时,我在jetty.xml中找到了以下设置

<Call name="addLifeCycle">
  <Arg>
    <New class="org.mortbay.jetty.deployer.ContextDeployer">
      <Set name="contexts"><Ref id="Contexts"/></Set>
      <Set name="configurationDir"><SystemProperty name="jetty.home" default="."/>/contexts</Set>
      <Set name="scanInterval">1</Set>
    </New>
  </Arg>
</Call>

The ContextDeployer will scan the configurationDir directory at intervals of scanInterval seconds for xml descriptors that define contexts.

在我的情况下,我必须为jar进行热部署。使用上面的配置,我如何指定为jar文件进行热部署。指定它将查找上下文文件中的更改。那么要重新部署我们是否需要更改上下文文件?请帮助我理解。

1 个答案:

答案 0 :(得分:3)

你的标记表明你正在使用Jetty 8,但是你的例子引用了org.mortbay类,它们将在我们几年前移植到Eclipse之前来自Jetty 6。

http://wiki.eclipse.org/Jetty/Feature/Hot_Deployment

在Jetty 7/8中,ContextDeployer被一个ContextProvider和更强大的部署生命周期所取代。在Jetty 9中,我们将ContextProvider和WebappProvider合并为一个(具有相同的部署生命周期设置)

http://www.eclipse.org/jetty/documentation/current/configuring-deployment.html

相关问题