Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Dropwizard Money

Build Status Coverage Status Maven Central GitHub license Become a Patron

A bundle for using Money objects in Dropwizard applications. This bundle provides:

  • Jackson module for serializing/deserializing Money/FastMoney objects
  • JDBI argument mappers for persisting Money objects as a BigDecimal SQL type
  • JDBI argument mappers for persisting FastMoney objects as a Numeric SQL type
  • Jersey MoneyParam for serializing/deserialzing Money objects
  • Jersey FastMoneyParam for serializing/deserialzing FastMoney objects
  • Jersey MonetaryExceptionMapper for handling MonetaryException


Within your Configuration class, add the following:

private final MoneyFactory money = new MoneyFactory();

public MoneyFactory getMoneyFactory() {
    return money;

Then within your Application class:

public void initialize(Bootstrap<MyConfiguration> bootstrap) {
    bootstrap.addBundle(new MoneyBundle<MyConfiguration>() {
        public MoneyFactory getMoneyFactory(MyConfiguration configuration) {
            return configuration.getMoneyFactory();

public void run(MyConfiguration config, Environment environment) throws Exception {
    final String defaultCurrency = config.getMoneyFactory().getDefaultCurrencyCode();

    final DBIFactory factory = new DBIFactory();
    final DBI jdbi =, config.getDataSourceFactory(), "postgresql");
    jdbi.registerArgumentFactory(new MoneyArgumentFactory());
    jdbi.registerColumnMapper(new MoneyMapper(defaultCurrency));

Maven Artifacts

This project is available on Maven Central. To add it to your project simply add the following dependencies to your pom.xml:



Please file bug reports and feature requests in GitHub issues.


Copyright (c) 2018 Smoke Turner, LLC

This library is licensed under the Apache License, Version 2.0.

See or the LICENSE file in this repository for the full license text.