maven jetty datasource 配置不好用
file11: web.xml
...
<resource-ref>
<description>The tokenDB DataSource Reference</description>
<res-ref-name>synnex/jdbc/tokenDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
...
file2:jetty.xml
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<New id="tokenDB" class="org.eclipse.jetty.plus.jndi.Resource" >
<Arg></Arg>
<Arg>synnex/jdbc/tokenDB</Arg>
<Arg>
<New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource" >
<Set name ="Url">jdbc:mysql://localhost:3308/mydb?allowMultiQueries=true</Set>
<Set name ="User">test</Set>
<Set name ="Password">test</Set>
</New>
</Arg>
</New>
file3:pom.xml
...
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.5.v20120716</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<jettyXml>src/main/resources/jetty.xml</jettyXml>
<webApp>
<contextPath>/creditcard-token</contextPath>
</webApp>
</Configure>
....