绑定的地址我已经下面增加一个maven-码头插件到我的POM:Maven的码头 - 插件无法在linux下
<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>
这工作正常的Windows 7下,但如果我尝试下执行它Linux(SuSE)它总是失败,并且地址已被使用。
我试了localhost和127.0.0.1作为jetty.host和一些数字作为端口。 我检查了linux系统上的端口,它们都没有被其他服务使用。
我在两个系统上都使用maven 3.0.3和JDK 1.6_29。
任何想法?
用户权限可能?另外,你使用的端口号是什么?我知道Linux保留了前1000个端口,但我猜你可能已经使用了8080,8180之类的东西。 – lucas1000001 2012-01-06 16:53:23
我用sudo运行,所以权限应该没有问题?我测试了3333,3344,8888,8080,8181,8282,9080等端口,效果都一样。 – cpater 2012-01-06 20:26:15
权限不是问题,因为端口大于1000 – 2012-01-09 08:33:38