我正在尝试在远程Tomcat 8上部署战争,但是在此过程中出现401(未授权)错误。
[ERROR] Tomcat return http status error: 401, Reason Phrase: Unauthorized
mvn tomcat7:redeploy
<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>
<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" />
请指导。
您需要为“ integration-tomcat”服务器定义凭据;这通常在〜/ .m2 / settings.xml文件中完成:
<servers> <server> <id>integration-tomcat</id> <username>manager</username> <password>manager</password> </server> </servers>