Reputation: 1099
I have added a maven-jetty plugin to my pom as follows:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.16</version>
<configuration>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<host>${jetty.host}</host>
<port>${jetty.port}</port>
<maxIdleTime>30000</maxIdleTime>
</connector>
</connectors>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopPort>${jetty.stop.port}</stopPort>
<stopKey>STOP</stopKey>
<contextPath>${jetty.contextpath}</contextPath>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>stop</goal>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
This works fine under windows 7 but if I try to execute it under Linux (SuSE) it always fails with address already in use.
I tried localhost and 127.0.0.1 as jetty.host and a few numbers as ports. I checked the ports on the linux system and they are all not in used by other services.
I use maven 3.0.3 and JDK 1.6_29 on both systems.
Any ideas?
Upvotes: 1
Views: 1395
Reputation: 149
try a different port with the following command
mvn -Djetty.port=7000 jetty:run
Upvotes: 0
Reputation: 7958
You can check which process has opened a port:
http://www.cyberciti.biz/faq/what-process-has-open-linux-port/
With
netstat -tulpn
You'll see the corresponding processes on the right side.
Upvotes: 0