Reputation: 33
I am trying to deploy from an exploded war directory, and I get the same context error (happens if I deploy from eclipse or if I try to deploy from the manager page, error output below):
My run configuration - war:exploded tomcat:exploded - copies the contents of the exploded war file to both \apache7\work\Catalina\localhost & \apache7\work\Catalina\localhost\mycontext
Is there an apache\tomcat configuration setting that I'm missing?
Any ideas are greatly appreciated!
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://***:8080/manager/text</url>
<path>/mycontext</path>
<warDirectory>
${project.build.directory}/exploded/${project.build.finalName}.war
</warDirectory>
<server>etomcat</server>
<username>${tomcat.username}</username>
<password>${tomcat.password}</password>
</configuration>
Output from eclipse: Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:exploded (default-cli) on project MyProject: Cannot invoke Tomcat manager: FAIL - Failed to deploy application at context path /mycontext
Log: 127.0.0.1 - tomcat [25/Jul/2013:14:05:28 -0400] "GET /manager/text/deploy?path=%2Fmycontext&war=file%3A%2FD%3A%2F[path to project] HTTP/1.1" 200 74
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:exploded (default-cli) on project MyProject: Cannot invoke Tomcat manager: FAIL - Failed to deploy application at context path /mycontext
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:exploded (default-cli) on project Pathways-Core-war: Cannot invoke Tomcat manager: FAIL - Failed to deploy application at context path /mycontext
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
...LifecycleModuleBuilder.buildProject(LifecycleModuleBuildere(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot invoke Tomcat manager: FAIL - Failed to deploy application at context path /mycontext
Upvotes: 1
Views: 2740
Reputation: 7406
The tomcat maven plugin has been moved to the Apache umbrella and been significantly updated since v1.1. I tried reverting to the mojo you're using, above, and could not get it to deploy either. There's a Tomcat7-specific mojo that works just fine.
Try using
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
...
</configuration>
</plugin>
instead. You can find all the documentation at https://tomcat.apache.org/maven-plugin-2.1/index.html
Upvotes: 1