maven-jetty-pluginを使用していて、jetty.xml設定を-Djetty.port = 8090でオーバーライドしようとしていますが、機能していません。jetty.xmlファイルからコネクタ部分を削除した場合にのみ、ポートは8090になります。
それで:
mvn jetty:run -Djetty.port=8090
コネクタはポート8080から始まります
コネクタなしでポート8090から開始
問題は、アクセプター、統計、その他のものを構成する必要があることです。コネクタからポートだけを外してみましたが、うまくいきませんでした。
私が使用しているもの:
JAVA 1.7_05
MAVEN 3.0.4
Jetty 8.1.4
Linux Ubuntu 12.04 64bits
これが私のpom.xmlプラグイン構成です:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.4.v20120524</version>
<configuration>
<stopKey>foo</stopKey>
<stopPort>9990</stopPort>
<jettyXml>src/main/webapp/WEB-INF/jetty.xml</jettyXml>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<!-- <phase>pre-integration-test</phase> -->
<goals>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<!-- <phase>post-integration-test</phase> -->
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
Jetty.xmlコネクタconf:
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="port"><Property name="jetty.port" default="8080"/></Set>
<Set name="maxIdleTime">300000</Set>
<Set name="Acceptors">4</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">20000</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
</New>
</Arg>
</Call>
前もって感謝します!
更新1:jetty.xmlでPropertyの代わりにSystemPropertyを使用してみました。動作しませんでした