Java Jetty ant任务配置
关于配置jetty ant任务的两个问题 为了让jetty在不同的端口上侦听,我在jetty.xml中执行以下操作:Java Jetty ant任务配置,java,ant,jetty,Java,Ant,Jetty,关于配置jetty ant任务的两个问题 为了让jetty在不同的端口上侦听,我在jetty.xml中执行以下操作: <Call name="addConnector"> <Arg> <New class="org.mortbay.jetty.nio.SelectChannelConnector"> <Set name="port"><SystemProperty name="jetty.por
<Call name="addConnector">
<Arg>
<New class="org.mortbay.jetty.nio.SelectChannelConnector">
<Set name="port"><SystemProperty name="jetty.port" default="9080"/></Set>
</New>
</Arg>
</Call>
并在ant脚本中引用它,例如
<jetty tempDirectory="..." jettyXml="...jetty.xml">
不幸的是,这只会让jetty同时装载9080和8080。如何使jetty不需要8080
第二个问题-jetty任务是否支持分岔jetty进程,或者我是否必须使用direct ant exec而不是使用jetty插件 无所谓。对于遇到相同问题的任何人,都可以这样解决:
<jetty tempDirectory="...">
<connectors>
<selectChannelConnector port="9999" />
</connectors>
</jetty>
删除jetty.xml,调用它添加引用的端口,而不是替换。与语法相似
< systemProperties>
<systemProperty name="jetty.port" value="9181"/>
</systemProperties>
它替换jetty xml中引用的端口,但添加到而不是覆盖默认端口