OpenEJB 5 + Groovy = service done fast!

If you read the previous post I wrote about ApplicationComposers run method you surely wonder what a service could look like using groovy and @Grab to resolve maven dependencies?

Here is a quick post showing it:

import org.apache.openejb.testing.ApplicationComposers
import org.apache.openejb.testing.Classes
import org.apache.openejb.testing.EnableServices
import org.apache.openejb.testing.SimpleLog



class Hi {
    String hi() {

class Run {

And that’s it,just hit run and you get your service deployed!

Just a little note about groovy: depending the distribution/setup of groovy you use to run it you can maybe desire remove servlet-api which is in groovy binary 2.4 distribution in 2.x version (OpenEJB 5 uses 3.1).
Another note about dependencies: at the moment openejb/javaee-api dependencies are on apache snapshot repository, if you don’t have them locally you can desire to configure grape to resolve them correctly.

Have fun with Groovy and OpenEJB microservices!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s