jetty-env.xml
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <!-- 应用数据源 --> <New id="wms" class="org.eclipse.jetty.plus.jndi.Resource"> <Arg>wms</Arg> <Arg> <New class="org.apache.commons.dbcp.BasicDataSource"> <Set name="driverClassName">com.mysql.jdbc.Driver</Set> <Set name="url">jdbc:mysql://10.19.105.184:3306/wms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true</Set> <Set name="username">ggs</Set> <Set name="password"></Set> <Set name="maxActive">30</Set> </New> </Arg> </New> </Configure>
pom.xml
<build> <pluginManagement> <plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.26</version> <configuration> <webAppSourceDirectory>${basedir}/src/main/webapp</webAppSourceDirectory> </configuration> </plugin> </plugins> </pluginManagement> </build>