maven 添加jetty 支持
maven jetty run 即可 配置
<plugin><groupId>org.mortbay.jetty</groupId><artifactId>jetty-maven-plugin</artifactId><version>8.1.9.v20130131</version><configuration><webApp><contextPath>/xxx</contextPath></webApp><connectors><connector implementation="org.eclipse.jetty.server.bio.SocketConnector"><port>8081</port><maxIdleTime>60000</maxIdleTime></connector><connector implementation="org.eclipse.jetty.server.ssl.SslSocketConnector"><port>8443</port><maxIdleTime>60000</maxIdleTime><password>123456</password><keyPassword>123456</keyPassword><keystore>${project.basedir}/src/test/resources/jetty.keystore</keystore></connector></connectors><systemProperties><systemProperty><!--一般服务器默认是ISO-8859-1编码--><name>org.eclipse.jetty.util.URI.charset</name><value>ISO-8859-1</value></systemProperty></systemProperties><!-- 从8.x开始,如果你的web项目中不包含数据库访问(或者说没有事务管理器)的话,在其启动时会提示找不到事务管理器启动过程会暂停十几秒,在反复调试代码时很浪费时间,因此加入如下的配置,这个配置文件没有其他用处--><contextXml>${project.basedir}/src/test/resources/jetty-context.xml</contextXml></configuration></plugin>
connector 是配置 协议 http 和 https的一些属性 ,比如端口,延迟什么的
我的配置
<plugin><groupId>org.mortbay.jetty</groupId><artifactId>jetty-maven-plugin</artifactId><version>7.1.6.v20100715</version><configuration><stopKey>stop</stopKey><stopPort>5599</stopPort><webAppConfig><contextPath>/iguanfang</contextPath></webAppConfig><scanIntervalSeconds>0</scanIntervalSeconds><connectors><connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"><port>9000</port><maxIdleTime>60000</maxIdleTime></connector></connectors></configuration></plugin>
浙公网安备 33010602011771号