O'Reilly logo

Maven for Eclipse by Sanjay Shah

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running an application

Now we are done with coding. Let's run the coding and see how it works. The project is a web application, so it requires a servlet container to run. We will use the Tomcat container here. Add the following build plugin for the Tomcat that can actually host a Tomcat instance right from Maven and no installation is required:

    <build>
….
  <plugins>
  <plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.1</version>
  </plugin>
  </plugins>
    </build>

This will download all the dependencies from the repository. After the download is complete, right-click on the project, choose Run As | Run Configurations..., create the configuration in the configuration window specifying Goals as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required