maven 添加jetty 支持


maven jetty run 即可 配置 


  1. <plugin>
  2. <groupId>org.mortbay.jetty</groupId>
  3. <artifactId>jetty-maven-plugin</artifactId>
  4. <version>8.1.9.v20130131</version>
  5. <configuration>
  6. <webApp>
  7. <contextPath>/xxx</contextPath>
  8. </webApp>
  9. <connectors>
  10. <connector implementation="org.eclipse.jetty.server.bio.SocketConnector">
  11. <port>8081</port>
  12. <maxIdleTime>60000</maxIdleTime>
  13. </connector>
  14. <connector implementation="org.eclipse.jetty.server.ssl.SslSocketConnector">
  15. <port>8443</port>
  16. <maxIdleTime>60000</maxIdleTime>
  17. <password>123456</password>
  18. <keyPassword>123456</keyPassword>
  19. <keystore>${project.basedir}/src/test/resources/jetty.keystore</keystore>
  20. </connector>
  21. </connectors>
  22. <systemProperties>
  23. <systemProperty>
  24. <!--一般服务器默认是ISO-8859-1编码-->
  25. <name>org.eclipse.jetty.util.URI.charset</name>
  26. <value>ISO-8859-1</value>
  27. </systemProperty>
  28. </systemProperties>
  29. <!-- 从8.x开始,如果你的web项目中不包含数据库访问(或者说没有事务管理器)的话,在其启动时会提示找不到事务管理器
  30. 启动过程会暂停十几秒,在反复调试代码时很浪费时间,因此加入如下的配置,这个配置文件没有其他用处-->
  31. <contextXml>${project.basedir}/src/test/resources/jetty-context.xml</contextXml>
  32. </configuration>
  33. </plugin>


connector 是配置 协议 http  和 https的一些属性 ,比如端口,延迟什么的

我的配置 

  1. <plugin>
  2. <groupId>org.mortbay.jetty</groupId>
  3. <artifactId>jetty-maven-plugin</artifactId>
  4. <version>7.1.6.v20100715</version>
  5. <configuration>
  6. <stopKey>stop</stopKey>
  7. <stopPort>5599</stopPort>
  8. <webAppConfig>
  9. <contextPath>/iguanfang</contextPath>
  10. </webAppConfig>
  11. <scanIntervalSeconds>0</scanIntervalSeconds>
  12. <connectors>
  13. <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
  14. <port>9000</port>
  15. <maxIdleTime>60000</maxIdleTime>
  16. </connector>
  17. </connectors>
  18. </configuration>
  19. </plugin>






posted on 2017-03-24 08:58  signheart  阅读(401)  评论(0编辑  收藏  举报

导航