jetty版本升级到7了,jetty 7 的maven plugin的配置较6发生了一些变化,如下:
1. pom配置
maven-jetty-plugin改成jetty-maven-plugin
connector implementation改成org.eclipse.jetty.server.nio.SelectChannelConnector
contextPath改到webAppConfig节点下
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<webDefaultXml>
src/main/resources/webdefault.xml
</webDefaultXml>
<webAppConfig>
<contextPath>/</contextPath>
</webAppConfig>
<scanIntervalSeconds>0</scanIntervalSeconds>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>80</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
2.jetty-evn.xml修改
WebAppContext改成org.eclipse.jetty.webapp.WebAppContext
Resource改成org.eclipse.jetty.plus.jndi.Resource
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<New id="postgresDb" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>jdbc/postgres</Arg>
<Arg>
<New class="org.postgresql.ds.PGPoolingDataSource">
<Set name="serverName">db.gohouse.cn</Set>
<Set name="databaseName">gehouse</Set>
<Set name="user">user</Set>
<Set name="password">pass</Set>
</New>
</Arg>
</New>
</Configure>
本文介绍从Jetty 6升级到7的过程中Maven插件配置的变化,包括pom文件中maven-jetty-plugin更改为jetty-maven-plugin、connectorimplementation更新为SelectChannelConnector以及contextPath的调整等。同时对jetty-env.xml文件中配置项的变更进行了说明。
9590

被折叠的 条评论
为什么被折叠?



