title: Compilation error while migrating Jersey from 1.x to 2.x
body: <p>My pom file contains:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;org.glassfish.jersey.core&lt;/groupId&gt;
    &lt;artifactId&gt;jersey-client&lt;/artifactId&gt;
    &lt;version&gt;2.22.1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.glassfish.jersey.core&lt;/groupId&gt;
    &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
    &lt;version&gt;2.22.1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.glassfish.jersey.core&lt;/groupId&gt;
    &lt;artifactId&gt;jersey-common&lt;/artifactId&gt;
    &lt;version&gt;2.22.1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt;
    &lt;artifactId&gt;jersey-media-json-jettison&lt;/artifactId&gt;
    &lt;version&gt;2.21.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>The error as appears in the log:
  <strong>Updated error:</strong></p>
  
  <pre><code>[INFO] --- maven-dependency-plugin:2.10:analyze-only (analyze) @ 
   api-services ---
  [WARNING] Unused declared dependencies found:
  [WARNING]    org.glassfish.jersey.core:jersey-client:jar:2.22.1:compile
  [WARNING]    org.glassfish.jersey.core:jersey-common:jar:2.22.1:compile
  [WARNING]    org.glassfish.jersey.core:jersey-server:jar:2.22.1:compile
  [WARNING]    org.glassfish.jersey.media:jersey-media-jaxb:jar:2.22.1:compile
  [WARNING]    org.glassfish.jersey.media:jersey-media-json-
     jackson:jar:2.22.1:compile
  Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:analyze-only (analyze) on project api-services: Dependency problems found -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:analyze-only (analyze) on project api-services: Dependency problems found
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  Caused by: org.apache.maven.plugin.MojoExecutionException: Dependency problems found
      at org.apache.maven.plugin.dependency.analyze.AbstractAnalyzeMojo.execute(AbstractAnalyzeMojo.java:260)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
  </code></pre>
  
  <p><strong>Update:</strong>
  After removing the above dependencies, I managed to build my project.
  So it looks like one of the above requires other dependencies. Any ideas?</p>
  
  <p><strong>Update 1:</strong>
  This is how analyse is defined</p>
  
  <pre><code>      &lt;execution&gt;
          &lt;phase&gt;package&lt;/phase&gt;
          &lt;goals&gt;
            &lt;goal&gt;analyse&lt;/goal&gt;
          &lt;/goals&gt;
        &lt;/execution&gt;
  </code></pre>