title: How do I migrate from Jersey 1.0 to Jersey 2.0?
body: <p>I'm trying to upgrade to Jersey 2.0 and I'm having a lot of trouble because the groupIds and artifactIds of Jersey have completely changed and I can't find a migration plan in the <a href="https://jersey.java.net/nonav/documentation/2.0/index.html" rel="noreferrer">Jersey docs</a>. </p>
  
  <p>Here's what my pom.xml used to look like, and this compiled fine:</p>
  
  <pre><code>        &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
              &lt;version&gt;1.17&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-servlet&lt;/artifactId&gt;
              &lt;version&gt;1.17&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-server-linking&lt;/artifactId&gt;
              &lt;version&gt;1.17.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-client&lt;/artifactId&gt;
              &lt;version&gt;1.17.1&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>What should these be changed to?  <a href="https://stackoverflow.com/questions/16216759/dependency-injection-with-jersey-2-0">This unrelated StackOverflow question was somewhat helpful,</a> but I'm having trouble finding things like where the <code>@Ref</code> annotation moved to.  </p>
  
  <hr>
  
  <h2>Update</h2>
  
  <ol>
  <li>It seems that <code>@Ref</code> no longer exists or at least <a href="https://jersey.java.net/nonav/documentation/2.0/uris-and-links.html" rel="noreferrer">it's not mentioned in the documentation anymore</a>.  Now you use a <code>UriBuilder</code>.  </li>
  <li><a href="https://jersey.java.net/nonav/documentation/2.0/modules-and-dependencies.html" rel="noreferrer">I found a very helpful section in the documentation that answers my maven issues</a>.</li>
  <li>The <code>HTTPBasicAuthFilter</code> has been renamed to <code>HttpBasicAuthFilter</code>.  Notice the capitalization.</li>
  <li><code>Client client = Client.create();</code> has become <code>Client client = ClientBuilder.newClient();</code></li>
  <li><p>This:</p>
  
  <pre><code>    String json = client
          .resource(getBaseUrl() + url)
          .accept(MediaType.APPLICATION_JSON_TYPE)
          .get(String.class);
  </code></pre>
  
  <p>has become</p>
  
  <pre><code>String json = client
          .target(getBaseUrl())
          .path(url)
          .request(MediaType.APPLICATION_JSON_TYPE)
          .get(String.class);
  </code></pre></li>
  </ol>