If no explicit configuration is provided then the Tomcat plugin defaults to the following:
These can be overridden as described below.
To configure the plugin for a different Tomcat instance, add a plugin configuration block to your pom.xml as follows:
<project>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://www.mydomain.com:1234/mymanager</url>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>
The default Tomcat manager URL is http://localhost:8080/manager.
To specify a different username and password to use when authenticating with Tomcat manager:
<project>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<server>myserver</server>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>
<settings>
...
<servers>
...
<server>
<id>myserver</id>
<username>myusername</username>
<password>mypassword</password>
</server>
...
</servers>
...
</settings>
The default authentication details are username admin and no password.
The default context path is /${project.build.finalName}, which itself defaults to /${artifactId}-${version}.
The preferred way of changing the context path is to change the finalName by adding the following to your pom.xml:
<project>
...
<build>
...
<finalName>mycontext</finalName>
...
</build>
...
</project>
Alternatively, a different context path can be specified by adding an explicit plugin configuration block to your pom.xml as follows:
<project>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<path>/mycontext</path>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>