Dropwizard bundle for processing and validating XMLs
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Dropwizard XML Bundle

Build Status Download

Dropwizard extension for high performance processing and validation of XML.


IntelliJ IDEA Ultimate Coded with IntelliJ IDEA


This project is built using Snap-CI to enable Continuous Delivery. There are no mysterious snapshots, every time the tests pass a new release tagged and uploaded to bintray, so you know exactly what you are pulling down.

Until 0.9.0, all versions are are pegged against Dropwizard's release number and try to use the same Jackson dependency to avoid conflicts. See above badges for latest version to use. The table below give an indication of dependencies:

Dropwizard-XML Dropwizard Jackson Woodstox Stax
0.7.1-X 0.7.1 2.3.3 4.1.4 3.1.1
0.8.0-X 0.8.0 2.5.1 transitive
0.8.1-X 0.8.1 2.5.2 transitive
0.9.0-X 0.9.0 2.6.3 transitive

After 0.9.0, the Dropwizard and Jackson dependencies are no longer bundled with this library. They are specified as gradle compileOnly scope (provided scope in Maven). It is up to you to provide the correct Dropwizard version and Jackson version combination in your classpath:

Dropwizard-XML Provide Dropwizard Provide Jackson
39 0.9.1, 0.9.2 2.6.3
39 0.9.3 2.6.7
41+ 1.0.0+ 2.7.5+

See dependencies below fore more details.


Dropwizard XML Provider is hosted by Bintray JCenter.

You can add the dependency to your project by Maven:


<!-- provided dependencies -->

Or Gradle:

repositories {
dependencies {
    compile "com.yunspace.dropwizard:dropwizard-xml:${dropwizardXmlVersion}"
    compile "io.dropwizard:dropwizard-core:1.0.0-rc4"
    compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-xml-provider:2.7.5"
    compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.7.5"

If you are using versions lesser than Dropwizard 1.0.0 and Jackson 2.7.5 you need to add jackson-datatype-jdk7




compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk7:2.6.7"


Add the XMLBundle

bootstrap.addBundle(new XmlBundle());

Annotate your Resources:

@Produces(MediaType.APPLICATION_XML) @Consumes(MediaType.APPLICATION_XML)

Annotate your model POJO with jackson-dataformat-xml bindings:

@JacksonXmlRootElement @JacksonXmlProperty @JacksonXmlElementWrapper @JacksonXmlText

Use validation/ignore annotations as you would normally:

@NotNull @Min @JsonIgnore

Advanced Usage

You can further custom the behaviour of your XML Mapper by passing in a JacksonXmlModule:

bootstrap.addBundle(new XmlBundle(jacksonXmlModule));

Or enable various serialisation/deserialisation features

XmlBundle indentXmlBundle = new XmlBundle();

##Sample project See dropwizard-xml-example subproject.


Add support for aalto