0、部署项目的tomcat是运行的
1、使用的tomcat7的maven插件的坐标
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
2、pom.xml
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
<version>3.0.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- 配置JDK的编译环境 -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>utf8</encoding>
</configuration>
</plugin>
<!-- 配置Tomcat插件 -->
<!-- 可用于远程热部署的tomcat 插件 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<username>tomcat</username>
<password>tomcat</password>
<path>/tomcat-web</path>
</configuration>
</plugin>
</plugins>
</build>
3、tomcat的con目录下的tomcat-users.xml配置
<role rolename="manager"/>
<role rolename="admin"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="tomcat" password="tomcat" roles="manager-script,admin,manager,manager-gui"/>
4、tomcat7-maven-plugin插件的运行命令
tomcat:deploy 部署一个web war包
tomcat:reload 重新加载web war包
tomcat:start 启动tomcat
tomcat:stop 停止tomcat
tomcat:undeploy 停止一个war包
tomcat:run 启动嵌入式tomcat ,并运行当前项目
5、关于运行的配置
6、tomcat插件运行截图