Preloader image

Inspired by the Jetty Maven Plugin, the TomEE Maven Plugin is a feature-rich plugin that allows for:

  • Easy provisioning of a TomEE server

  • Server start and stop

  • Application deployment and undeployment

Simply add the following to the <plugins> and optionally the <pluginManagement> section of your pom.xml


Plugin Goals

Goal Description


Create TomEE, but do not run it.


Run the Apache Tomcat configtest command.


Same as run but with debug activated on the default or specified port.


Deploy an application in a running TomEE.


Creates an executable jar of the application.


Display help information on the tomee-maven-plugin. Call mvn tomee:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.


Largely inspired by the OpenEJB command helper, but with some differences. List deployed EJB’s in a running TomEE.


Start and wait for TomEE.


Start TomEE and continue.


Stop a TomEE started with start command.


Undeploy an application in a running TomEE

Note 1: For tomee:deploy and tomee:undeploy goals, the path can either be specified within the section of the pom.xml using the parameter, or it can be passed via the user property tomee-plugin.archive. If a relative path is passed for the deploy path archive, this must be relative to the TomEE server.

Note 2: While running TomEE Maven Plugin, you can type quit directly in the console to shutdown the server correctly. reload is also available when internal openejb application is deployed.

More Tweaks

The lib tag allows to enrich the container with some additional libraries.

Some interesting patterns in addition to the default maven formats are supported.

  • remove:<some prefix of jar in lib folder>: remove all jar starting with the specified prefix

  • unzip:<some maven zip>: extract the zip in lib folder

  • ?name=<new-name>: rename the libary once copied in lib folder

Note: the name tweak can be used to rename applications too

Provisioning Example

This plugin is also usable in projects which are not war. For instance you can use it in a pom project to setup a TomEE install, add libraries, deploy apps then run the server.


Auto Reloading Example

        <extension>.class</extension> <!-- if you want to update each time you build with mvn compile -->

The Synchronization block supports the following configuration options:

  • resourcesDir (default src/main/webapp)

  • binariesDir (default target/classes)

  • targetBinariesDir (default tomee/webapps/finalName/WEB-INF/classes)

  • targetResourcesDir (default tomee/webapps/finalName)

  • updateInterval (default 5 - in second)

  • extensions (default html, xhtml, js and css)

  • regex: a regex should match files to take into account when updating

  • reloadOnUpdate means to reload the entire context (webapp), i.e. undeploying/redeploying the application.