Saturday May 19

Links

Books

Key Concepts

User Menu

AddThis

AddThis Social Bookmark Button

Maven Tomcat deployment

PDFPrintE-mail
Friday, 29 April 2011 12:41
AddThis Social Bookmark Button


Maven Tomcat Deployment Tutorial 


Maven Tomcat  deployment tutorial

The codehaus  Maven tomcat plugin is a very clean and effective way to deploy on Tomcat. If you are looking for a mor advanced solution agnostic in the term of server your can use the Maven Cargo plugin

Requirements

ElementVersion
Maven version 2 or late
JDK 1.5
Memory no minimum requirement

Define tomcat server in maven settings.xml

<server>
        <id>tomcat</id>
        <username>manager</username>
        <password>password</password>
</server>

Include the following snippet in the <build><plugins> section of your project's pom.xml-file:

Maven plugin configuration

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <configuration>
         <url>http://127.0.0.1:8080/manager</url>
        <server>tomcat</server>
        <path>/test</path>
    </configuration>
</plugin>


Tomcat Maven plugin troubleshootingTroublehooting

403 Error with Tomcat 7 

Tomcat Maven plugin version 1.1 doesn't support Tomcat 7. If your trying to use the tomcat-maven-plugin on Tomcat 7, you may get a 403 error because Tomcat 7 has changed the deployment url from

http://localhost:8080/manager

to

http://localhost:8080/manager/html

Tags: maven, plugin, http, deployment, version, error, server, tomcat, tomcat-maven-plugin, 8080/manager

Add comment


Security code
Refresh