在pom文件build节点下加入
<outputDirectory>${project.basedir}/src/main/webapp/WEB-INF/classes/</outputDirectory>
web配置
- tomcat6
1 2 3 4 5 6 7 8 9 10 11
| <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat6-maven-plugin</artifactId> <version>${tomcat.version}</version> <configuration> <port>${webserver.port}</port> <path>/${project.artifactId}</path> <uriEncoding>${project.build.sourceEncoding}</uriEncoding> </configuration> </plugin>
|
- tomcat7
1 2 3 4 5 6 7 8 9 10 11
| <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>${tomcat.version}</version> <configuration> <port>${webserver.port}</port> <path>/${project.artifactId}</path> <uriEncoding>${project.build.sourceEncoding}</uriEncoding> </configuration> </plugin>
|
- jetty
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>${jetty.version}</version> <configuration> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>${webserver.port}</port> </connector> </connectors> <webAppConfig> <contextPath>/${project.artifactId}</contextPath> </webAppConfig> <systemProperties> <systemProperty> <name>org.mortbay.util.URI.charset</name> <value>${project.build.sourceEncoding}</value> </systemProperty> </systemProperties> </configuration> </plugin>
|