eclipse maven tomcat7 热部署
1.maven
切换 D:\apache-maven-3.5.2\conf\setting.xml 添加
<server>
<id>tomcat7-admin</id>
<username>admin</username>
<password>admin</password>
</server>
2.pom.xml
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<!-- 注意此处的url manager/text 必须要添加 -->
<url>http://localhost:8080/manager/text</url>
<server>tomcat7-admin</server> <!-- 此处的名字必须和setting.xml中配置的ID一致 -->
<username>root</username>
<password>pasken</password>
<path>/ROOT</path> <!-- 此处的名字是项目发布的工程名 -->
</configuration>
</plugin>
</plugins>
3.修改tomcat7的配置文件tomcat_users.xml
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui"/>
在 D:\apache-tomcat-7.0.92\conf\context.xml 文件修改为 <Context reloadable="true">
4.手动启动tomcat /bin/startup.bat
5.启动项目
第一次部署时在eclise中执行 run as ->run configer 配置 tomcat7:deploy
以后再重新热部署的时候部署的命令改为 tomcat7:redeploy