Maven tomcat7: deploy with status code: 403, ReasonPhrase: Forbidden

I am using the tomcat maven plugin to deploy my java web application. Now everything works when I use tomcat 7.0.32, this is my plugin configuration

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
       <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.1</version>
            <configuration>
                <url>http://localhost:8080/manager/text</url>
                <server>my-tomcat</server>
                <path>/myapp</path>
            </configuration>
</plugin>

my setup settings.xml

<servers>
   <server>
        <id>my-tomcat</id>
        <username>manager</username>
        <password>pwd</password>
   </server>
</servers>

my tomcat-users.xml

<role rolename="manager-gui"/>
<user username="managerGui" password="pwd" roles="manager-gui"/>

<role rolename="manager-script"/>
<user username="manager" password="pwd" roles="manager-script"/>

and if another version of tomcat is used, for example 7.0.50, I get the following error:

code: 403, ReasonPhrase: Forbidden

I am also trying to connect to tomcat 7.0.50 when

 http://localhost:8080/manager/text

and doesn't work, while with version 7.0.32 I get an authentication popup.

Where am I doing wrong?

+4
source share
1 answer

, , settings.xml C:\Users {userName} \. m2\ <settings> <servers> <server> <id>my-tomcat</id> <username>manager</username> <password>pwd</password> </server> </servers> </settings>

- % MAVEN_HOME%/conf/settings.xml , C:\Users {_}.m2\settings.xml

+2

Source: https://habr.com/ru/post/1523337/


All Articles