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.