如何设置(修改)jetty(maven插件maven
展开全部
在使用jetty的maven插件,有两种方式来改变jetty server的端口,第一种方式较为简单,即:
通过命令行指定端口:
mvn -Djetty.port=9999 jetty:run
另一种方式是在pom中的配置中通过指定新的connector来实现的,例如下述的配置文档:<plugin<groupIdorg.mortbay.jetty</groupId
<artifactIdmaven-jetty-plugin</artifactId
<version6.1.26</version
<configuration
<scanIntervalSeconds3</scanIntervalSeconds
<connectors
<connector implementation=org.mortbay.jetty.nio.SelectChannelConnector
<port9090</port
</connector
</connectors
<scanTargetPatterns
<scanTargetPattern
<directorysrc/main/webapp/WEB-INF</directory
<excludes
<exclude**/*.jsp</exclude
</excludes
<includes
<include**/*.properties</include
<include**/*.xml</include
</includes
</scanTargetPattern
</scanTargetPatterns
通过命令行指定端口:
mvn -Djetty.port=9999 jetty:run
另一种方式是在pom中的配置中通过指定新的connector来实现的,例如下述的配置文档:<plugin<groupIdorg.mortbay.jetty</groupId
<artifactIdmaven-jetty-plugin</artifactId
<version6.1.26</version
<configuration
<scanIntervalSeconds3</scanIntervalSeconds
<connectors
<connector implementation=org.mortbay.jetty.nio.SelectChannelConnector
<port9090</port
</connector
</connectors
<scanTargetPatterns
<scanTargetPattern
<directorysrc/main/webapp/WEB-INF</directory
<excludes
<exclude**/*.jsp</exclude
</excludes
<includes
<include**/*.properties</include
<include**/*.xml</include
</includes
</scanTargetPattern
</scanTargetPatterns
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询