title: How to avoid dependency conflict when using dropwizard + jersey client
body: <p>I have a DropWizard REST API written and works. One of the resource endpoints actually writes an email, however as soon as I add the following dependencies DropWizard starts to fail on start up</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-client&lt;/artifactId&gt;
          &lt;version&gt;1.18.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-core&lt;/artifactId&gt;
          &lt;version&gt;1.18.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey.contribs&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-multipart&lt;/artifactId&gt;
          &lt;version&gt;1.18.1&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>The DropWizard dependency is:</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;io.dropwizard&lt;/groupId&gt;
          &lt;artifactId&gt;dropwizard-core&lt;/artifactId&gt;
          &lt;version&gt;0.8.1&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>The error on startup is really long, summarised below</p>
  
  <pre><code>    WARN  [2015-05-01 20:06:08,887] org.glassfish.jersey.internal.Errors: The following warnings have been detected: WARNING: Unknown HK2 failure detected:
  MultiException stack 1 of 2
  java.lang.NullPointerException
      at com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.setConfiguration(AbstractJAXBProvider.java:113)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      ....
      MultiException stack 2 of 2
  java.lang.IllegalStateException: Unable to perform operation: method inject on com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App
      at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:395)
      ....
      MultiException stack 3 of 3
  java.lang.IllegalStateException: Unable to perform operation: create on org.glassfish.jersey.message.internal.MessageBodyFactory
      ...
  </code></pre>
  
  <p>I'm guessing DropWizard is using another conflicting dependency so how do I deal with this?</p>
  
  <p>Thanks in advance</p>