Run embedded Tomcat 8 in Maven

The most common way to run your Java web app using Maven in an embedded container is the Tomcat Maven Plugin. However, the latest version of this plugin is for Tomcat 7 (last update released back in 2013).

Luckily there is another plugin that you can use, the Maven Cargo Plugin.

Here is an example working configuration that you can use with the plugin.


You can run your project using Cargo by using the cargo:run goal of the plugin. This will download the specified tomcat version and deploy your app into it.

Please note the ${tomcat.version} property, which you need to define in your pom.xml.