Jetty 9+Maven 修改默认启动端口

9以下版本修改配置:

  1. <plugin>  
  2.     <groupId>org.mortbay.jettygroupId>  
  3.     <artifactId>maven-jetty-pluginartifactId>  
  4.     <version>6.1.26version>  
  5.     <configuration>               
  6.         <scanIntervalSeconds>3scanIntervalSeconds>  
  7.         <connectors>  
  8.             <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">  
  9.                 <port>9090port>  
  10.             connector>  
  11.         connectors>                     
  12.         <scanTargetPatterns>  
  13.             <scanTargetPattern>  
  14.                 <directory>src/main/webapp/WEB-INFdirectory>  
  15.                 <excludes>  
  16.                     <exclude>**/*.jspexclude>  
  17.                 excludes>  
  18.                 <includes>  
  19.                     <include>**/*.propertiesinclude>  
  20.                     <include>**/*.xmlinclude>  
  21.                 includes>  
  22.             scanTargetPattern>  
  23.         scanTargetPatterns>  
  24.     configuration>  
  25. plugin> 

9以上的版本,添加以下内容无效。

  1. <connectors>  
  2.             <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">  
  3.                 <port>9090port>  
  4.             connector>  
  5.         connectors>              

查看官方文档,发现节点变成了,在下新增节点即可,完整配置如下:


   org.eclipse.jetty
   jetty-maven-plugin
   9.2.6.v20141205
   
      stop
      9999
      5
      ${project.basedir}/src/main/resources/jetty-context.xml
      
         /NeuPushService
      
      
         8082
      
   

 

点我查看官网配置说明

 

你可能感兴趣的:(Jetty,Jetty)