Maven comes up with a powerful list of features and plugins for rapid application development, deployment and testing.
While developing web applications, the need is always felt to deploy, undeploy and redeploy applications using the command line. For apache tomcat, maven comes up with a tomcat-maven-plugin which facilitates the same.
1. Follow the steps mentioned in the post for creating a simple web application.
2. Add the below lines in your pom.xml. This will download the tomcat-maven-plugin jar in your local maven repository.
<build>
<finalName>webapp</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://localhost:8080/manager/text</url>
<username>admin</username>
<password>admin</password>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Read more ...