查看了StackOverFlow中顯示的大部分錯誤,但仍無法解決此問題。我正在嘗試部署SpringMVC應用程序。但是,我無法讓它工作。Tomcat-Maven 401錯誤:無法調用Tomcat管理器
Maven的部署錯誤:
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy (default-cli) on project productmgmt: Cannot invoke Tomcat manager: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/text/deploy?path=%2Fproductmgmt&war=&update=true -> [Help 1]
的pom.xml:
<build>
<finalName>productmgmt</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://localhost:8080/manager/text</url>
<path>/productmgmt</path>
<username>admin</username>
<password>password</password>
</configuration>
</plugin>
</plugins>
</build>
的Tomcat-users.xml中
<role rolename="admin"/>
<role rolename="manager"/>
<user username="admin" password="admin" roles="admin,manager"/>
</tomcat-users>
更多信息:
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
這爲我工作
<role rolename="manager-script"/>
<role rolename="admin-script"/>
<user password="password" roles="manager-script,admin-script" username="admin"/>
</tomcat-users>
admin-script thingy爲我做了。不知道這個角色。謝謝,救生員! – SysHex