一、配置pom.xml,在overview視窗裏,配置packaging爲 warjava
二、解決錯誤:web.xml is missing and <failOnMissingWebXml> is set to trueweb
在pom.xml文件裏添加如下內容apache
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin>
三、在項目上右鍵,執行Maven->Updatetomcat
四、在項目上右鍵,執行Run As->Maven installapp
五、若是須要引入非Maven倉庫的jar包,添加以下配置webapp
<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>
六、遇到war包裏文件不更新的狀況,把WEB-INF下的classes目錄刪除,以前配置過把文件編譯到這裏。maven
七、遇到tomcat下的文件不更新,是由於修改了tomcat的配置文件code
<Context docBase="D:\www\antsclub" path="" reloadable="true"/></Host>xml