Reputation: 3897
I'm trying to automatically deploy a Maven webapp from Eclipse Java EE to my local Tomcat server. I'm using Windows XP. This is the error:
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project practicaIW: Cannot invoke Tomcat manager: Server returned HTTP response code: 403 for URL: http://127.0.0.1:8080/manager/deploy?path=%2Fpractica-3&war= -> [Help 1]
I think I know the reason of this error:
pom.xml extract:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://127.0.0.1:8080/manager</url>
<username>admin</username>
<password>password</password>
<server>TomcatServer</server>
<path>/practica-3</path>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
tomcat-users.xml extract:
<tomcat-users>
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="admin"/>
<role rolename="manager-script"/>
<user password="password" roles="admin,manager,manager-gui,manager-script" username="admin"/>
</tomcat-users>
UPDATE: pvm14 answered the question. But previously you have to open the file: Tomcat v7.0 Server at localhost.server. Here is how:
Upvotes: 1
Views: 8559
Reputation: 544
The Tomcat server you start from inside Eclipse isn't going to have a 'Tomcat Manager' console available (localhost:8080/manager) unless you configure it with this option:
This means that the Tomcat you start from Eclipse is exactly the one you provided when defining the Tomcat server in the IDE. Otherwise Eclipse runs a pruned version, without manager available, in a directory located inside the workspace:
{workspace_dir}\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
If you don't have a tomcat manager available in the instance you're running tomcat-maven-plugin won't be able to deploy anything
Best regards
Upvotes: 3