I am running a Tomcat 7 as a windows service. And i want to do mvn:tomcat deploy in my projects root directory.
But all the time this error appears, can you help me with this plz?
[INFO] Deploying war to http://localhost:8080/opendata
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.493s
[INFO] Finished at: Sun Jan 20 18:48:30 CET 2013
[INFO] Final Memory: 15M/39M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy
(default-cli) on project opendata: Cannot invoke Tomcat manager: Server returned
HTTP response code: 405 for URL: http://localhost:8080/manager/deploy?path=%2Fo
pendata&war= -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
I got the following section in my pom file:
<build>
<finalName>opendata</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<server>myserver</server>
</configuration>
<version>1.1</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
Two things needed to get this to work;
That's it. See example conf for pom.xml below. And don't forget to use tomcat7:redeploy so you don't have to cycle undeploy/deploy.
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://your-server:8080/manager/text</url>
<username>a-username</username>
<password>a-password</password>
<path>/a-path</path>
</configuration>
</plugin>
I ran into a similar issue today - the 405 error can be caused by Tomcat not accepting PUT requests. This can be allowed by configuring Tomcat's web.xml (typically found in %TOMCAT%\conf\web.xml
), and adding the following init-param:
<init-param>
<param-name>readonly</param-name>
<param-value>false</param-value>
</init-param>
You might also need to add an admin user to the tomcat-users.xml. See here for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With