Coming Up for Air

Getting Started with Eclipse MicroProfile, Part 5: TomEE

In this installment of our series, we’re going to take a look at the last of what I think of as the more traditional, app-server-based/-spawned implementations, TomEE. TomEE is a fully Java EE-enabled distribution of the venerable workhorse Tomcat, and comes with support for creating MicroProfile applications, so let’s see what that looks like.

This should come as no surprise at this point, but setting up a TomEE-based project requires little effort. We start by adding these dependencies to our web project:




Notice that the only compile/runtime dependency is our shared code. The rest is for testing.

We’ll need a plugin to bundle our application:


The exec goal will build our uberjar, and we set the context to ROOT so that our application is deployed on the root context.

# mvn install
# java -jar target/tomee-1.0-SNAPSHOT-exec.jar
# curl http://localhost:8080
Hello, world
# curl http://localhost:8080/?name=TomEE
Hello, TomEE

We already have our Arquillian dependencies added, and there are no additional configuration files needed for this very basic case, so we can run our tests via mvn test as we’ve seen many times already.

As Emeril would say, BAM! We’re all done. Things get more complicated as the project gets more complicated, but I’ll try to discuss that in our wrap up.

Stay tuned for an implementation of a different color next time when we look at Hammock.

You can find the source for the whole project here, and for this part here.


Sample quote

Quote source