1、工程pom.xml 文件
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://ip:port/manager/text</url>
<username>admin</username>
<password>admin</password>
<update>true</update>
<path>/admin</path>
</configuration>
</plugin>
注: 用户密码可以在maven setting 中配置server ,然后引用
2、配置tomcat9
1、注释掉manager工程metainfo 下面文件context.xml 中的value ,这个限制ip
2、再tomcat9/conf/tomcat-user.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"/>
3、执行
mvn clean package
mvn tomcat7:deploy
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://ip:port/manager/text</url>
<username>admin</username>
<password>admin</password>
<update>true</update>
<path>/admin</path>
</configuration>
</plugin>
注: 用户密码可以在maven setting 中配置server ,然后引用
2、配置tomcat9
1、注释掉manager工程metainfo 下面文件context.xml 中的value ,这个限制ip
2、再tomcat9/conf/tomcat-user.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"/>
3、执行
mvn clean package
mvn tomcat7:deploy