分类目录归档:Java

jetty maven插件设置jetty端口设置

转自:http://www.cnblogs.com/xiazh/articles/2293015.html

eclipsemaven插件的安装:

http://m2eclipse.sonatype.org/sites/m2e

jettymaven插件中有两种方式设置jetty的端口(默认为:8080)。

第一种,通过命令行,在启动jetty的时候设置:mvn -Djetty.port=10086 jetty:run

第二种,是在mavenpom文件中进行设置:


<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<connectors>
<connector implementation=”org.mortbay.jetty.nio.SelectChannelConnector”>
<port>10086</port>
</connector>
</connectors>
<scanTargetPatterns>
<scanTargetPattern>
<directory>src/main/webapp/WEB-INF</directory>
<excludes>
<exclude>**/*.jsp</exclude>
</excludes>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</scanTargetPattern>
</scanTargetPatterns>
</configuration>


mvn jetty:run -Djetty.port=10086 -pl app-loupan