我想做mvn clean package tomcat7:deploy但总是得到这个错误:tomcatManager status code:403, ReasonPhrase:Forbbiden
我的配置是下一个:
〜/ .m2目录/ settings.xml中
<servers>
<server>
<id>localhost</id>
<username>tomcat</username>
<password>s3cret</password>
</server>
</servers>
Run Code Online (Sandbox Code Playgroud)
的pom.xml
<profiles>
<profile>
<id>tomcat-localhost</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<tomcat-server>localhost</tomcat-server>
<tomcat-url>http://localhost:8080/manager/html</tomcat-url>
</properties>
</profile>
</profiles>
<build>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<server>${tomcat-server}</server>
<url>${tomcat-url}</url>
</configuration>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
的tomcat-users.xml中
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
Run Code Online (Sandbox Code Playgroud)
我的错是什么?因为我没有看到它.
完成邮件错误:
[INFO] --- tomcat7-maven-plugin:2.0:deploy (default-cli) @ WebApp ---
[INFO] Deploying war to http://localhost:8080/Baskeitor
Uploading: http://localhost:8080/manager/html/deploy?path=%2FWebApp
Uploaded: http://localhost:8080/manager/html/deploy?path=%2FWebApp (7985 KB at 50215.2 KB/sec)
[INFO] tomcatManager status code:403, …Run Code Online (Sandbox Code Playgroud)