我这里自己建了个maven 项目
下面是pom文件
4.0.0
com.imooc.webdemo
webdemo
war
0.0.1-SNAPSHOT
webdemo Maven Webapp
http://maven.apache.org
junit
junit
3.8.1
test
javax.servlet
javax.servlet-api
3.1.0
provided
webdemo
<plugins>
<plugin>
<!-- 3个可用插件 -->
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
http://localhost:8080/manager/text
admin
admin 8080
这里查到这个项目的所在工作目录
用命令行进入这个目录
然后maven编译
然后它就会自己操作编译
然后刷新下自己项目就可以看到这个war包