maven jetty插件配置 jetty6
2011-05-26 19:29 hanwesley 阅读(792) 评论(0) 编辑 收藏 举报<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<jettyEnvXml>src/main/resources/jetty-env.xml</jettyEnvXml> <!--数据源配置-->
<webAppSourceDirectory>target/deploy/tu-crm.war</webAppSourceDirectory>
<contextPath>/</contextPath>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>80</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<systemProperties>
<systemProperty>
<name>productionMode</name>
<value>false</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
</plugins>
<resource-ref> <description>My DataSource Reference</description> <res-ref-name>jdbc/DSTest</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<New id="Test" class="org.mortbay.jetty.plus.naming.Resource">
<Arg>jdbc/alimamaDataSource</Arg>
<Arg>
<New class="org.apache.commons.dbcp.BasicDataSource">
<Set name="driverClassName">oracle.jdbc.driver.OracleDriver</Set>
<Set name="url">jdbc:oracle:thin:@localhost:1521:alimmdb1</Set>
<Set name="username">usr</Set>
<Set name="password">pwd</Set>
</New>
</Arg>
</New>
</Configure>
参考资料:http://wiki.eclipse.org/Jetty/Howto/Configure_JNDI_Datasource