Skip to main content

If you are looking for the fastest way to download, install, and run TomEE with or without webapps, then look no further! This blog post shows how to use the TomEE Maven Plugin to easily install and run TomEE and webapps with a single command.

Clean TomEE Install

The TomEE Maven Plugin will download, install, and run TomEE with a single Maven command:

$ mvn tomee:run

Just copy the pom.xml file below – (you can also get it from GitHub) – then run the command above and the TomEE Maven Plugin will download, install, and run a clean installation of TomEE. I say “clean” because the install does not include any Tomcat/TomEE default webapps. Type exit at the prompt when you want to stop the server.

Let’s take a quick look at the pom.xml file to see how it works.

<project xmlns="" xmlns:xsi=""
  <name>TomEE :: Examples :: Install</name>
            <args>-Xmx512m -XX:PermSize=256m</args>

It’s pretty simple. The major thing to observe is the TomEE Maven Plugin (highlighted in green), which takes care of downloading, installing, and running TomEE.

You can copy and paste the pom.xml listing above or you can get it along with an example WAR by cloning the tomee-mvn-installation-example project on GitHub.

Default TomEE Install

You can add the default Tomcat/TomEE webapps by including the <removeDefaultWebapps>false</removeDefaultWebapps> to the TomEE plug-in configurations options as shown below:

    <args>-Xmx512m -XX:PermSize=256m</args>

WAR First TomEE Install

A WAR First TomEE install uses the TomEE Maven Plugin declared in a webapp. In other words, you start with a webapp’s pom.xml which downloads, installs, and runs TomEE with the webapp’s WAR file deployed. This is a great way to create complete TomEE applications without having to start with a TomEE server.

As an example, shut down the TomEE instance if you have it running by typing “exit” at the command prompt. If you haven’t cloned the example project, do so now. Next move the prompt into the hello-servlet directory under the cloned project.

$ get clone
$ cd tomee-mvn-installation-example/hello-servlet

Now, execute mvn clean install tomee:run.

$ mvn clean install tomee:run

With TomEE running use your web browser or cUrl to check if the webapp was deployed. It should return Hello World.

$ curl http://localhost:8080/hello-servlet/

Hello World

TomEE Maven Plugin: Configuration Parameters

In addition to the regular Maven parameters the TomEE plugin offers eleven optional configuration parameters. I’m going to talk about four of them but all eleven are documented on “TomEE Maven Plugin” pages (here and here) at the Apache TomEE web site. Each command includes over two dozen parameters which are either set by default or not required.


This command will download and install TomEE but will not run it.


This command will download, install and run TomEE in the foreground. You could also call this after tomee:build to run an already installed TomEE. You exit TomEE by typing “quit” or “exit”.


This command will download, install, and run TomEE in a background thread freeing up the command window.


This command will quit or exit an TomEE instance that was run with tomee:start.


The TomEE Maven Plugin is really powerful as it makes it easier to do a number of operations on an existing TomEE instance in addition to downloading, installing, and running a fresh instance. Using the Maven plugin, TomEE can be installed and run with or without a fully deployed webapp. More documentation on the configuration options can be found here.

Richard Monson-Haefel

Richard Monson-Haefel

Richard has more the 24 years of experience as a professional software developer and architect. He has written five books on enterprise Java including EJB, JMS, web services, and software architecture. He has served on the JCP executive committee and multiple expert groups, is the co-founder of OpenEJB and Apache Geronimo, was a Sr. Analyst for Burton Group (aka Gartner), and is a celebrated public speaker.


Leave a Reply