1、配置pom.xml,在overview视窗里,配置packaging为 war
2、解决错误:web.xml is missing and <failOnMissingWebXml> is set to true
在pom.xml文件里添加以下内容
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
3、在项目上右键,执行Maven->Update
4、在项目上右键,执行Run As->Maven install
5、如果需要引入非Maven仓库的jar包,添加如下配置
<dependency>
<groupId>org.apache</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/taobao-sdk-java-auto_1455552377940-20160607.jar</systemPath>
</dependency>
6、遇到war包里文件不更新的情况,把WEB-INF下的classes目录删除,之前配置过把文件编译到这里。
7、遇到tomcat下的文件不更新,是因为修改了tomcat的配置文件
<Context docBase="D:\www\antsclub" path="" reloadable="true"/></Host>