When I use mvn tomcat:deploy of tomcat-maven-plugin there is a 403 error:
Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.0:deploy (default-cli) on pr
If you are using Tomcat 7:
Change your configuration in pom.xml to use the Tomcat 7 version of the plugin
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<url>http://127.0.0.1:8080/manager/html</url>
<server>TomcatServer</server>
<path>/your_context</path>
<username>some_user_name</username>
<password>some_password</password>
</configuration>
</plugin>
Notice the and values - they are DIFFERENT from the ones for Tomcat 6.
<server> <id>TomcatServer</id> <username>some_user_name</username> <password>some_password</password> </server>
This is also possible:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<server>myserver</server>
<username>admin</username>
<password>admin</password>
</configuration>
</plugin>
There are a few steps one must be sure that are accomplished. this can be a true black hole.
If your are using tomcat-maven-plugin from org.codehaus.mojo, you must use this configuration:
<configuration>
<url>http://localhost:8080/manager/text</url>
<warFile>your_war_filename.war</warFile>
<server>server_name_on_settingsxml</server>
</configuration>
Please ensure that you have 'server_name_on_settingsxml' server credentials defined on maven settings.xml. Use mvn tomcat:deploy (you must use this 'tomcat' prefix), this is the only way that when deploying the above configurations are read.
However if you are using tomcat7-maven-plugin from org.apache.tomcat.maven, you must use mvn tomcat7:deploy. The 'tomcat7' prefix will read configuration from plugin:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
I was using tomcat:deploy, and i had on the pom.xml the tomcat7-maven-plugin defined. So, the maven deploy was never reading my configurations tag...
If you ensure you have usernames and passwords correctly define and you use the correct plugin when deploying, it will work.