1.配置tomcat的界面访问账号和权限
./tomcat/conf目录下tomcat-users.xml添加
这里是根据自己的需求添加的一个角色权限
1
2
3
4
5
6
7 |
<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= "minsup"
password= "123456"
roles= "manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui" /> |
2.配置pom.xml文件添加tomcat-maven-plugin插件
1
2
3
4
5
6
7
8
9 |
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <version>1.1</version> <configuration> <url>http: //10.2.19.23:8080/manager/text</url><!--tomcat的管理访问地址--> <server>tomcat</server> <!-- 此处的名字必须和setting.xml中配置的ID一致--> </configuration> </plugin> |
3.setting文件中添加tomcat的访问权限
1
2
3
4
5 |
<server> <id>tomcat</id> <username>minsup</username><!--tomcat的账号--> <password>123456</password><!--tomcat的密码--> </server> |
4.执行mvn install tomcat:redeploy 自动部署tomcat
maven 热部署至tomcat,布布扣,bubuko.com
原文:http://www.cnblogs.com/mengyu/p/3729439.html