简体   繁体   English

码头蚁任务配置

[英]Jetty ant task configuration

Two questions on configuring the jetty ant task 有关配置码头蚂蚁任务的两个问题

to get jetty to listen on a different port, I'm doing this in the jetty.xml: 为了让码头在不同的端口上监听,我在jetty.xml中这样做:

<Call name="addConnector">
    <Arg>
        <New class="org.mortbay.jetty.nio.SelectChannelConnector">
            <Set name="port"><SystemProperty name="jetty.port" default="9080"/></Set>
        </New>
    </Arg>
</Call>

and referencing this in the ant script, eg 并在ant脚本中引用它,例如

<jetty tempDirectory="..." jettyXml="...jetty.xml">

Unfortunately this simply gets jetty to load both 9080 and 8080. How do I get jetty to not require 8080? 不幸的是,这只会让码头同时装载9080和8080。我如何让码头不需要8080?

Second question - does the jetty task support forking the jetty process, or do I have to do that with a direct ant exec instead of using the jetty plugin? 第二个问题-码头任务是否支持派生码头程序,还是我必须直接蚂蚁高管代替使用码头插件来做到这一点?

Nevermind. 没关系。 For anyone stuck with the same issue, it can be solved like this: 对于遇到同样问题的任何人,都可以这样解决:

<jetty tempDirectory="..."> 
     <connectors>
        <selectChannelConnector port="9999" />
      </connectors>
  </jetty>

The jetty.xml is removed, calling that adds the referenced port rather than replacing. jetty.xml被删除,调用该方法添加引用的端口而不是替换。 Similar to the syntax 类似于语法

< systemProperties>
    <systemProperty name="jetty.port" value="9181"/>
  </systemProperties>

which replaces the port referenced in the jetty xml but adds to instead of overwriting the default port. 它替换了在jetty xml中引用的端口,但添加了该端口而不是覆盖默认端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM