Uso il plug-in maven-jetty e provo a eseguire l'override dell'impostazione jetty.xml con -Djetty.port = 8090 ma non funziona. Solo quando rimuovo la parte del connettore dal file jetty.xml ottengo la porta da 8090.Come eseguire l'override di jetty.xml con jetty.port
Quindi:
mvn jetty:run -Djetty.port=8090
Con il connettore inizia nel 8080
Senza il connettore inizia a porta 8090
Problema è necessario configurare creditori, statistiche e altre cose. Ho provato a rimuovere solo la porta dal connettore ma non ha funzionato.
sto usando:
JAVA 1.7_05
MAVEN 3.0.4
Jetty 8.1.4
Linux Ubuntu 12.04 64bits
Ecco la mia pom.xml configurazione del plugin: connettore
<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>
Grazie in anticipo!
UPDATE 1: ha anche provato a utilizzare SystemProperty anziché Property nel jetty.xml. Non ha funzionato
Nel caso in cui un lettore non vuole ignorare un jetty.xml file , quindi utilizzando una proprietà di sistema per sostituire la porta predefinita nel pom funziona: ' \t \t \t pontile.porto \t \t $ {} jetty.port \t systemProperty> SystemProperties> configuration> ' –
MiB
Il commento precedente dovrebbe essere la risposta accettata –