在build的plugins部分添加以下插件:
如果报servlet-api包冲突,pom中需添加以下类似配置:
或者,如果有以下依赖,scope中添加test或provided
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<!-- http port -->
<port>8080</port>
<path>/</path>
<uriEncoding>utf-8</uriEncoding>
<ignorePackaging>true</ignorePackaging>
<systemProperties>
<JAVA_OPTS>-Xms256m -Xmx512m -XX:MaxPermSize=256m</JAVA_OPTS>
</systemProperties>
</configuration>
</plugin>
如果报servlet-api包冲突,pom中需添加以下类似配置:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
或者,如果有以下依赖,scope中添加test或provided
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib-ext-spring</artifactId>
<version>1.0.2</version>
<scope>test</scope>
</dependency>