For maven web application, it can be run in tomcat server without installing tomcat server locally!!
Yes, its true!!
Here maven provides a plugin for tomcat instance, which will used to deploy and run the web application using a simple maven command “tomcat7:run”.
For this, first we have to configure the web application’s pom.xml with following plugin configuration.
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.0</version> <!-- Use version 2.2 if JDK 8 --> <configuration> <path>/${project.build.finalName}</path> </configuration> </plugin>
HereΒ path is used to configure the root context for the application.
After adding the above, just use the maven command mvn tomcat7:runΒ to run this application in tomcat server.