title: How come my pom.xml dependency isn't found for my Jenkins plugin?
body: <p>My <code>pom.xml</code> has this dependency:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;net.sf.json-lib&lt;/groupId&gt;
      &lt;artifactId&gt;json-lib&lt;/artifactId&gt;
      &lt;version&gt;2.4&lt;/version&gt;
      &lt;classifier&gt;jdk15&lt;/classifier&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>When I use the <code>XMLSerializer</code> it throws an exception: <code>java.lang.NoClassDefFoundError: nu/xom/Node</code></p>
  
  <p>If I run the class locally and add the JAR to my classpath, everything works as expected. I'm running this class as a Jenkins plugin so I don't expect to be manually defining classpath - I figured that's what Maven should be handling.</p>
  
  <p>It's important to note that Jenkins plugins require me uploading an <code>hpi</code> file that is created from Maven. It is not running based on the output <code>jar</code>. If I go on Jenkins box and manually put the xom JAR into <code>WEB-INF/libs</code>, it works. But obviously that means this plugin wouldn't for other people, which is self-defeating.</p>
  
  <p>Here is minimal code causing error: <a href="https://github.com/DaveStein/parser-sample" rel="nofollow noreferrer">https://github.com/DaveStein/parser-sample</a></p>
  
  <p>The Readme has exact repro steps.</p>
  
  <p><strong>Note on chosen answer</strong>
  The PR to my sample repo got me most of the way to where I needed to be. I did have a few other issues that had to get resolved, but the JSONObject conflict was the core problem. I took out all GlobalConfiguration as Jesse's PR suggested. The only other issue that might concern a future viewer was some glitch when using <code>xom</code> as explicit dependency while also using a higher version than 1.626 for <code>org.jenkins-ci.plugins</code> at the time of this post.</p>