title: Maven dependencies for REST API - Jersey - Glassfish or not?
body: <p>I'm new to REST API and little familiar with Maven. I noticed that most people use REST with Jersey implementation. I need to write POST requests and might also need GET requests as well. I have difficulty finding out the right - minimum required - dependencies for Maven to start coding.</p>
  
  <p>I looked at many resources online. Looks like Jersey comes with Glassfish Server. I have Tomcat installed on my local PC which I'm going to use for development of REST and testing. We have Jboss running on our production servers which my code eventually will be deployed to. It looks to me that different resources say different things or there are chances I'm not getting it!</p>
  
  <p>1) Can I use Jersey with Tomcat or Jboss WITHOUT any dependency on Glassfish?</p>
  
  <p>2) Back to the Maven dependencies;</p>
  
  <p>Here I found:</p>
  
  <p><a href="http://aike.me/site/blog/20090914/restful_web-services_in_java_using_jax-rs_-_part_1_getting_up_and_running" rel="nofollow">http://aike.me/site/blog/20090914/restful_web-services_in_java_using_jax-rs_-_part_1_getting_up_and_running</a></p>
  
  <pre><code>Maven: Getting Jersey into your project
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;maven2-repository.dev.java.net&lt;/id&gt;
          &lt;name&gt;Java.net Repository for Maven&lt;/name&gt;
          &lt;url&gt;http://download.java.net/maven/2/&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
      &lt;version&gt;1.0.3.1&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.sun.xml.bind&lt;/groupId&gt;
      &lt;artifactId&gt;jaxb-impl&lt;/artifactId&gt;
      &lt;version&gt;2.1.12&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
      &lt;artifactId&gt;jsr311-api&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
      &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
      &lt;version&gt;2.1&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Are these would be ALL I need?</p>
  
  <p>B/c in Jersey website I found different dependencies defined:</p>
  
  <p><a href="https://jersey.java.net/documentation/latest/modules-and-dependencies.html" rel="nofollow">https://jersey.java.net/documentation/latest/modules-and-dependencies.html</a></p>
  
  <p>I won't copy and paste those dependencies here b/c it makes this post very long. I do NOT see any of these dependencies - mentioned in <a href="http://aike.me" rel="nofollow">http://aike.me</a> defined in:</p>
  
  <p><a href="https://jersey.java.net" rel="nofollow">https://jersey.java.net</a></p>
  
  <p>Such as:</p>
  
  <pre><code>&lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
  
  &lt;artifactId&gt;jaxb-impl&lt;/artifactId&gt;
  
  &lt;artifactId&gt;jsr311-api&lt;/artifactId&gt;
  
  &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
  </code></pre>
  
  <p>Why is that? Why I'm being referred to different dependencies?</p>
  
  <p>Any help is greatly appreciated.</p>