title: Adding Jersey MOXy fails Jetty run
body: <p>I'm testing out REST using Jersey, Hibernate and embedded Jetty. Initially, I was able to start everything up using <code>./gradlew clean jar &amp;&amp; java -jar build/libs/&lt;project&gt;.jar</code>. However, I wanted to support JSON and read from docs that MOXy is Jersey's default JSON provider. So I added the following in my <code>build.gradle</code> file:</p>
  
  <pre><code>compile 'org.glassfish.jersey.media:jersey-media-moxy:2.19'
  </code></pre>
  
  <p>After which, I tried to build the jar and start up jetty but I get the following issue:</p>
  
  <pre><code>Error: A JNI error has occurred, please check your installation and try again
  Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
      at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:284)
      at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:238)
      at java.util.jar.JarVerifier.processEntry(JarVerifier.java:273)
      at java.util.jar.JarVerifier.update(JarVerifier.java:228)
      at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
      at java.util.jar.JarFile.getInputStream(JarFile.java:450)
      at sun.misc.URLClassPath$JarLoader$2.getInputStream(URLClassPath.java:940)
      at sun.misc.Resource.cachedInputStream(Resource.java:77)
      at sun.misc.Resource.getByteBuffer(Resource.java:160)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:454)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
  </code></pre>
  
  <p>Here's my <code>build.gradle</code> file if it helps.</p>
  
  <pre><code>apply plugin: 'eclipse'
  apply plugin: 'java'
  apply plugin: 'jetty'
  
  repositories {
      jcenter()
  }
  
  dependencies {
      compile 'org.slf4j:slf4j-api:1.7.12'
  
      // Jetty
      compile 'org.eclipse.jetty:jetty-server:9.3.1.v20150714'
      compile 'org.eclipse.jetty:jetty-servlet:9.3.1.v20150714'
  
      // Jersey
      compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.19'
      compile 'org.glassfish.jersey.core:jersey-client:2.19'
      compile 'org.glassfish.jersey.media:jersey-media-moxy:2.19'
      compile 'org.glassfish.jersey.media:jersey-media-json-processing:2.19'
      compile 'org.glassfish.jersey.media:jersey-media-multipart:2.19'
      compile 'org.glassfish.jersey.media:jersey-media-sse:2.19'
  
      // Hibernate
      compile 'mysql:mysql-connector-java:5.1.36'
      compile 'org.hibernate:hibernate-core:4.3.10.Final'
      compile 'com.mchange:c3p0:0.9.5.1'
  
      testCompile 'junit:junit:4.12'
  }
  
  jar {
      from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
      manifest {
          attributes 'Main-Class': 'com.domain.scaffolding.Main'
      }
  }
  </code></pre>