At bloomhealth we use
dropwizard to build small, fast web
services. Recently I’ve been contributing to Peter Ledbrook’s
lazybones project templating
system and I finally made time to build a template for dropwizard.
The template creates a default directory structure, an empty service
implementation and a gradle build. There are some custom gradle tasks
for running migrations and starting the service. It includes
dependencies for testing with spock as well. You can see the
You can install lazybones via gvm. If you’re not using gvm, then you
Filtering file /Users/kboon/temp/gradle.properties
[move] Moving 2 files to
You have created an dropwizard application using lazybones. The
application will start but it has no resources
configured for it yet. To find out where to go from here, visit the
There is a working service, liquibase migrations, hibernate support and
a basic gradle build system including some
shortcuts to the commands for running migrations and starting the
| +- groovy
| | +- your.package.structure
| | +- core
| | +- db
| | +- healthchecks
| | +- resources
| | +- core
| +- resources
| +- // Spock tests in here!
# Running The Application
To test the example application run the following commands.
* To run the tests run
* To package the example run.
* To drop an existing h2 database run.
* To setup the h2 database run.
* To run the server run.
Project created in /Users/kboon/temp!
And you’re ready to go! At this point you can run the service using
gradle run. Gradle will build and test the application, create a
runnable jar with the shadow plugin and then start the service. When you
do, you will notice a warning from dropwizard because there are no
resources defined yet so there are no available routes for the service.
This is where you pick up…
The next version of the template will include gradle tasks to generate
swager documention and run gatling load tests.