Skip to content

A template repository for Dropwizard Groovy applications

License

Notifications You must be signed in to change notification settings

cratekube/dropwizard-groovy-template

Repository files navigation

dropwizard-groovy-template

License SemVer Download Build Status Coverage Status

A template repository for Dropwizard Groovy applications

Configuration

Internal and external services are configured by extending the Dropwizard application configuration with additional settings. An environment variable parser is used to allow configuration settings to be overridden at runtime. These configuration options can be seen in the app config file.

Local development

Gradle builds

This project uses gradle for building and testing. We also use the gradle wrapper to avoid downloading a local distribution. The commands below are helpful for building and testing.

  • ./gradlew build compile and build the application
  • ./gradlew check run static code analysis and test the application
  • ./gradlew shadowJar builds a fat jar that can be used to run the Dropwizard application

After you have generated the fat jar you can run your application with java using:

java -jar build/libs/dropwizard-groovy-template-1.0.0-SNAPSHOT-all.jar

Docker builds

We strive to have our builds repeatable across development environments so we also provide a Docker build to generate the Dropwizard application container. The examples below should be executed from the root of the project.

Running the base docker build:

docker build --target build .

Generating the Dropwizard application docker image:

docker build --target package -t my-app .

Using the API client

This application generates a client for the Dropwizard application by using the swagger specification. The maven asset is available in JCenter, make sure you include the JCenter repository (https://jcenter.bintray.com/) when pulling this client. To use the client provide the following dependency in your project:

Gradle:

implementation 'io.cratekube:dropwizard-groovy-template:1.0.0'

Maven:

<dependency>
  <groupId>io.cratekube</groupId>
  <artifactId>dropwizard-groovy-template</artifactId>
  <version>1.0.0</version>
</dependency>

API Documentation

The API docs for this project are powered by the Swagger Specification. After starting up the application the available APIs can be found at http://localhost:<configured port>/swagger

Contributing

If you are interested in contributing to this project please review the contribution guidelines. Thank you for your interest in CrateKube!