合并war包
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> <overlays> <overlay> <groupId>com.htht</groupId> <artifactId>user</artifactId> </overlay> <overlay> <groupId>com.htht</groupId> <artifactId>userweb</artifactId> </overlay> </overlays> </configuration> </plugin>
增加依赖
<dependency> <groupId>com.htht</groupId> <artifactId>user</artifactId> <version>0.0.1-SNAPSHOT</version> <type>war</type> </dependency> <dependency> <groupId>com.htht</groupId> <artifactId>common</artifactId> <version>0.0.1-SNAPSHOT</version> <type>jar</type> </dependency>
jetty插件
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.16.v20140903</version> <configuration> <scanIntervalSeconds>10</scanIntervalSeconds> <stopPort>9999</stopPort> <webAppConfig> <contextPath>/user</contextPath> </webAppConfig> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>9080</port> <maxIdleTime>60000</maxIdleTime> </connector> </connectors> </configuration> </plugin>