【发布时间】:2014-10-01 20:51:47
【问题描述】:
我正在尝试在远程 Tomcat 8 上部署战争,但在此过程中出现 401(未经授权)错误。
错误日志
[ERROR] Tomcat return http status error: 401, Reason Phrase: Unauthorized
为部署执行的命令
mvn tomcat7:redeploy
pom.xml
<properties>
<integration.tomcat.url>http://gsi-547576:8080/manager/text</integration.tomcat.url>
</properties>
<!-- Deploy to Remote Tomcat -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>${integration.tomcat.url}</url>
<server>integration-tomcat</server>
<path>/${project.artifactId}</path>
</configuration>
</plugin>
tomcat-users.xml
<role rolename="tomcat" />
<role rolename="manager-gui" />
<role rolename="manager-script" />
<role rolename="admin-gui" />
<user username="manager" password="manager" roles="tomcat,manager-gui,admin-gui,manager-script" />
请指导。
【问题讨论】: