title: Spark 2.x + Tika: java.lang.NoSuchMethodError: org.apache.commons.compress.archivers.ArchiveStreamFactory.detect
body: <p>I am trying to resolve a spark-submit classpath runtime issue for an Apache Tika (>v 1.14) parsing job.  The problem seems to involve spark-submit classpath vs my uber-jar. </p>
  
  <p>Platforms: CDH 5.15 (<a href="https://www.cloudera.com/documentation/spark2/latest/topics/spark2_packaging.html#versions" rel="noreferrer">Spark 2.3 added via CDH docs</a>) and CDH 6 (Spark 2.2 bundled in CDH 6)</p>
  
  <p>I've tried / reviewed:</p>
  
  <p><a href="https://community.cloudera.com/t5/Advanced-Analytics-Apache-Spark/Where-does-spark-submit-look-for-Jar-files/m-p/44795/highlight/true#M1981" rel="noreferrer">(Cloudera) Where does spark-submit look for Jar files?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/41383460/resolving-dependency-problems-in-apache-spark">(stackoverflow) resolving-dependency-problems-in-apache-spark</a></p>
  
  <p><a href="https://stackoverflow.com/questions/50412099/apache-tika-archivestreamfactory-detect-error">(stackoverflow) Apache Tika ArchiveStreamFactory.detect error</a></p>
  
  <p><strong>Highlights:</strong></p>
  
  <ul>
  <li>Java 8 / Scala 2.11</li>
  <li>I'm building an uber-jar and calling that uber-jar via spark-submit</li>
  <li>I've tried adding --jars option to spark-submit call (see further down in this post)</li>
  <li>I've tried adding --conf spark.driver.userClassPathFirst=true &amp;&amp;
  --conf spark.executor.userClassPathFirst=true to spark-submit call (see further down in this post):</li>
  </ul>
  
  <p><strong>Results if I include --conf flag(s) to spark-submit:</strong></p>
  
  <pre><code>$ spark-submit --master local[*] --class com.example.App --conf spark.executor.userClassPathFirst=true ./target/uber-tikaTest-1.19.jar
  
  18/09/25 13:35:55 ERROR util.Utils: Exception encountered
  java.lang.NullPointerException
      at org.apache.spark.rdd.ParallelCollectionPartition$$anonfun$readObject$1.apply$mcV$sp(ParallelCollectionRDD.scala:72)
      at org.apache.spark.rdd.ParallelCollectionPartition$$anonfun$readObject$1.apply(ParallelCollectionRDD.scala:70)
      at org.apache.spark.rdd.ParallelCollectionPartition$$anonfun$readObject$1.apply(ParallelCollectionRDD.scala:70)
      at org.apache.spark.util.Utils$.tryOrIOException(Utils.scala:1307)
      at org.apache.spark.rdd.ParallelCollectionPartition.readObject(ParallelCollectionRDD.scala:70)
      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:498)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2136)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2245)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2169)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
      at org.apache.spark.serializer.JavaDeserializationStream.readObject(JavaSerializer.scala:75)
      at org.apache.spark.serializer.JavaSerializerInstance.deserialize(JavaSerializer.scala:114)
      at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:312)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
  18/09/25 13:35:55 ERROR util.Utils: Exception encountered
  java.lang.NullPointerException
      at org.apache.spark.rdd.ParallelCollectionPartition$$anonfun$readObject$1.apply$mcV$sp(ParallelCollectionRDD.scala:72)
      at org.apache.spark.rdd.ParallelCollectionPartition$$anonfun$readObject$1.apply(ParallelCollectionRDD.scala:70)
      at org.apache.spark.rdd.ParallelCollectionPartition$$anonfun$readObject$1.apply(ParallelCollectionRDD.scala:70)
      at org.apache.spark.util.Utils$.tryOrIOException(Utils.scala:1307)
      at org.apache.spark.rdd.ParallelCollectionPartition.readObject(ParallelCollectionRDD.scala:70)
      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:498)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2136)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2245)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2169)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
      at org.apache.spark.serializer.JavaDeserializationStream.readObject(JavaSerializer.scala:75)
      at org.apache.spark.serializer.JavaSerializerInstance.deserialize(JavaSerializer.scala:114)
      at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:312)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
  </code></pre>
  
  <p><strong>Below the following error message are files for:</strong></p>
  
  <ul>
  <li>build-and-run.sh script (calls spark-submit -- notes about options
  included)</li>
  <li>sample app</li>
  <li>pom.xml</li>
  <li>mvn dependency tree output (which shows the "missing"
  commons-compress library is included within the uber-jar)</li>
  </ul>
  
  <p><strong>The error at runtime:</strong></p>
  
  <pre><code>18/09/25 11:47:39 ERROR executor.Executor: Exception in task 1.0 in stage 0.0 (TID 1)
  java.lang.NoSuchMethodError: org.apache.commons.compress.archivers.ArchiveStreamFactory.detect(Ljava/io/InputStream;)Ljava/lang/String;
      at org.apache.tika.parser.pkg.ZipContainerDetector.detectArchiveFormat(ZipContainerDetector.java:160)
      at org.apache.tika.parser.pkg.ZipContainerDetector.detect(ZipContainerDetector.java:104)
      at org.apache.tika.detect.CompositeDetector.detect(CompositeDetector.java:84)
      at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:116)
      at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:159)
      at com.example.App$.tikaAutoDetectParser(App.scala:55)
      at com.example.App$$anonfun$1.apply(App.scala:69)
      at com.example.App$$anonfun$1.apply(App.scala:69)
      at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
      at org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1799)
      at org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1158)
      at org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1158)
      at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:2071)
      at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:2071)
      at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)
      at org.apache.spark.scheduler.Task.run(Task.scala:109)
      at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:338)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
  18/09/25 11:47:39 ERROR executor.Executor: Exception in task 5.0 in stage 0.0 (TID 5)
  java.lang.NoSuchMethodError: org.apache.commons.compress.archivers.ArchiveStreamFactory.detect(Ljava/io/InputStream;)Ljava/lang/String;
      at org.apache.tika.parser.pkg.ZipContainerDetector.detectArchiveFormat(ZipContainerDetector.java:160)
      at org.apache.tika.parser.pkg.ZipContainerDetector.detect(ZipContainerDetector.java:104)
      at org.apache.tika.detect.CompositeDetector.detect(CompositeDetector.java:84)
      at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:116)
      at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:159)
      at com.example.App$.tikaAutoDetectParser(App.scala:55)
      at com.example.App$$anonfun$1.apply(App.scala:69)
      at com.example.App$$anonfun$1.apply(App.scala:69)
      at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
      at org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1799)
      at org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1158)
      at org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1158)
      at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:2071)
      at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:2071)
      at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)
      at org.apache.spark.scheduler.Task.run(Task.scala:109)
      at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:338)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
  </code></pre>
  
  <p><strong>build-and-run.sh:</strong></p>
  
  <p>Notes:</p>
  
  <ul>
  <li>I've tried adding the --conf flags for userClassPathFirst in both
  master and yarn configs below,</li>
  <li>using the --jar flag to specify the uber-jar generated from mvn
  compile with the pom.xml (provided further down in the post)</li>
  </ul>
  
  <p>build-and-run.sh</p>
  
  <pre><code>mvn compile
  
  if true
  then
  spark-submit --master local[*] --class com.example.App ./target/uber-tikaTest-1.19.jar
  fi
  
  # tried the using the userClass flags for driver and executor for above and below calls to spark-submit
  # --conf spark.driver.userClassPathFirst=true \
  # --conf spark.executor.userClassPathFirst=true \
  
  if false 
  then
  spark-submit --class com.example.App \
   --master yarn \
   --packages org.apache.commons:commons-compress:1.18 \
   --jars ./target/uber-tikaTest-1.19.jar \
   --num-executors 2 \
   --executor-memory 1024m \
   --executor-cores 2 \
   --driver-memory 2048m \
   --driver-cores 1 \
   ./target/uber-tikaTest-1.19.jar
  fi
  </code></pre>
  
  <p><strong>Sample App:</strong></p>
  
  <pre><code>package com.example
  ////////// Tika Imports
  import org.apache.tika.metadata.Metadata
  import org.apache.tika.parser.AutoDetectParser
  import org.apache.tika.sax.BodyContentHandler
  ////////// Java HTTP Imports 
  import java.net.URL;
  import java.net.HttpURLConnection
  import scala.collection.JavaConverters._
  import scala.collection.mutable._
  ////////// Spark Imports 
  import org.apache.spark.SparkConf
  import org.apache.spark.SparkContext
  import org.apache.spark.storage.StorageLevel
  import org.apache.spark.sql.{Row,SparkSession}
  
  
  object App {
    case class InputStreamData(sourceURL: String, headerFields: Map[String,List[String]], inputStream: java.io.InputStream)
  
    def openUrlStream(sourceURL:String,apiKey:String):(InputStreamData) = {
      try {
       val url = new URL(sourceURL)
           val urlConnection = url.openConnection().asInstanceOf[HttpURLConnection] 
       urlConnection.setInstanceFollowRedirects(true)
           val headerFields = urlConnection.getHeaderFields()
           val input = urlConnection.getInputStream()
       InputStreamData(sourceURL, headerFields.asScala.map(x =&gt; (x._1,x._2.asScala.toList)), input)
      }
        catch {
        case e: Exception =&gt; {
          println("**********************************************************************************************")
          println("PARSEURL: INVALID URL: " + sourceURL)
          println(e.toString())
          println("**********************************************************************************************")
  
          InputStreamData(sourceURL, Map("ERROR" -&gt; List("ERROR")), null)
        }
      }
    }
  
    def tikaAutoDetectParser(inputStream:java.io.InputStream):String = {
      var parser = new AutoDetectParser();
      var handler = new BodyContentHandler(-1);
      var metadata = new Metadata();
      parser.parse(inputStream, handler, metadata);
      return handler.toString()
    }
  
    def main(args : Array[String]) {
      var sparkConf = new SparkConf().setAppName("tika-1.19-test")
      val sc = new SparkContext(sparkConf) 
      val spark = SparkSession.builder.config(sparkConf).getOrCreate()
      println("HELLO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
      var urls = List("http://www.pdf995.com/samples/pdf.pdf", "https://www.amd.com/en", "http://jeroen.github.io/images/testocr.png")
  
      var rdd = sc.parallelize(urls)
      var parsed = rdd.map(x =&gt; tikaAutoDetectParser(openUrlStream(x,"").inputStream))
      println(parsed.count)
    }
  }
  </code></pre>
  
  <p><strong>pom.xml (builds uber-jar):</strong></p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.example&lt;/groupId&gt;
    &lt;artifactId&gt;tikaTest&lt;/artifactId&gt;
    &lt;version&gt;1.19&lt;/version&gt;
    &lt;name&gt;${project.artifactId}&lt;/name&gt;
    &lt;description&gt;Testing tika 1.19 with CDH 6 and 5.x, Spark 2.x, Scala 2.11.x&lt;/description&gt;
    &lt;inceptionYear&gt;2018&lt;/inceptionYear&gt;
    &lt;licenses&gt;
      &lt;license&gt;
        &lt;name&gt;My License&lt;/name&gt;
        &lt;url&gt;http://....&lt;/url&gt;
        &lt;distribution&gt;repo&lt;/distribution&gt;
      &lt;/license&gt;
    &lt;/licenses&gt;
  
  
   &lt;repositories&gt;
      &lt;repository&gt;
        &lt;id&gt;cloudera&lt;/id&gt;
        &lt;url&gt;https://repository.cloudera.com/artifactory/cloudera-repos/&lt;/url&gt;
      &lt;/repository&gt;
    &lt;/repositories&gt;
  
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;scala-2.11.12&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;scalaVersion&gt;2.11.12&lt;/scalaVersion&gt;
              &lt;scalaBinaryVersion&gt;2.11.12&lt;/scalaBinaryVersion&gt;
          &lt;/properties&gt;
          &lt;dependencies&gt;
              &lt;!-- ************************************************************************** --&gt;
              &lt;!-- GOOD DEPENDENCIES +++++++++++++++++++++++++++++++++++++ --&gt;
              &lt;!-- ************************************************************************** --&gt;
  
              &lt;!-- https://mvnrepository.com/artifact/org.apache.commons/commons-compress --&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
                  &lt;artifactId&gt;commons-compress&lt;/artifactId&gt;
                  &lt;version&gt;1.18&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;!-- *************** CDH flavored dependencies ***********************************************--&gt;
              &lt;!-- https://www.cloudera.com/documentation/spark2/latest/topics/spark2_packaging.html#versions --&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
                  &lt;artifactId&gt;spark-core_2.11&lt;/artifactId&gt;
                  &lt;version&gt;2.2.0.cloudera3&lt;/version&gt;
                  &lt;!-- have tried scope provided / compile --&gt;
                  &lt;!--&lt;scope&gt;provided&lt;/scope&gt;--&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                      &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
                      &lt;artifactId&gt;spark-sql_2.11&lt;/artifactId&gt;
                      &lt;version&gt;2.2.0.cloudera3&lt;/version&gt;
                      &lt;!-- have tried scope provided / compile --&gt;
                      &lt;!--&lt;scope&gt;provided&lt;/scope&gt;--&gt;
                  &lt;/dependency&gt;
  
                  &lt;!-- https://mvnrepository.com/artifact/org.apache.tika/tika-core --&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.apache.tika&lt;/groupId&gt;
                      &lt;artifactId&gt;tika-core&lt;/artifactId&gt;
                      &lt;version&gt;1.19&lt;/version&gt;
                  &lt;/dependency&gt;
  
                  &lt;!-- https://mvnrepository.com/artifact/org.apache.tika/tika-parsers --&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.apache.tika&lt;/groupId&gt;
                      &lt;artifactId&gt;tika-parsers&lt;/artifactId&gt;
                      &lt;version&gt;1.19&lt;/version&gt;
                  &lt;/dependency&gt;
  
                  &lt;!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api --&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
                      &lt;artifactId&gt;javax.ws.rs-api&lt;/artifactId&gt;
                      &lt;version&gt;2.1.1&lt;/version&gt;
                  &lt;/dependency&gt;
  
              &lt;!-- https://mvnrepository.com/artifact/org.scala-lang/scala-library --&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
                      &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
                      &lt;version&gt;2.11.12&lt;/version&gt;
                  &lt;/dependency&gt;
  
  
              &lt;!-- **************************************************************************************************************************
              **************************** alternative dependencies that have been tried and yield same Tika error***************************
              *******************************************************************************************************************************--&gt;
              &lt;!-- https://mvnrepository.com/artifact/org.apache.spark/spark-core --&gt;
                  &lt;!--
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
                      &lt;artifactId&gt;spark-core_2.11&lt;/artifactId&gt;
                      &lt;version&gt;2.2.0&lt;/version&gt;
                  &lt;/dependency&gt;
                  --&gt;
  
              &lt;!-- https://mvnrepository.com/artifact/org.apache.spark/spark-sql --&gt;
                  &lt;!--
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
                      &lt;artifactId&gt;spark-sql_2.11&lt;/artifactId&gt;
                      &lt;version&gt;2.2.0&lt;/version&gt;
                  &lt;/dependency&gt;
                  --&gt;
  
              &lt;/dependencies&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  
  
      &lt;build&gt;
          &lt;sourceDirectory&gt;src/main/scala&lt;/sourceDirectory&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.5.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;net.alchim31.maven&lt;/groupId&gt;
                  &lt;artifactId&gt;scala-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.2.2&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                              &lt;goal&gt;testCompile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;args&gt;
                          &lt;!-- work-around for https://issues.scala-lang.org/browse/SI-8358 --&gt;
                          &lt;arg&gt;-nobootcp&lt;/arg&gt;
                      &lt;/args&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1.1&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;shade&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;filters&gt;
                          &lt;filter&gt;
                              &lt;artifact&gt;*:*&lt;/artifact&gt;
                              &lt;excludes&gt;
                                  &lt;exclude&gt;META-INF/*.SF&lt;/exclude&gt;
                                  &lt;exclude&gt;META-INF/*.DSA&lt;/exclude&gt;
                                  &lt;exclude&gt;META-INF/*.RSA&lt;/exclude&gt;
                              &lt;/excludes&gt;
                          &lt;/filter&gt;
                      &lt;/filters&gt;
                      &lt;finalName&gt;uber-${project.artifactId}-${project.version}&lt;/finalName&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>mvn dependency tree:</strong></p>
  
  <p>Notes:</p>
  
  <p>$ mvn dependency:tree -Ddetail=true | grep compress</p>
  
  <pre><code>[INFO] +- org.apache.commons:commons-compress:jar:1.18:compile
  [INFO] | +- com.ning:compress-lzf:jar:1.0.3:compile
  </code></pre>
  
  <p>$ mvn dependency:tree -Ddetail=true | grep commons</p>
  
  <pre><code>[INFO] +- org.apache.commons:commons-compress:jar:1.18:compile
  [INFO] | | | \- commons-collections:commons-collections:jar:3.2.2:compile
  [INFO] | | | +- commons-cli:commons-cli:jar:1.2:compile
  [INFO] | | | +- commons-httpclient:commons-httpclient:jar:3.1:compile
  [INFO] | | | +- commons-configuration:commons-configuration:jar:1.6:compile
  [INFO] | | | | +- commons-digester:commons-digester:jar:1.8:compile
  [INFO] | | | | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
  [INFO] | | | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
  [INFO] | +- org.apache.commons:commons-lang3:jar:3.5:compile
  [INFO] | +- org.apache.commons:commons-math3:jar:3.4.1:compile
  [INFO] | +- commons-net:commons-net:jar:2.2:compile
  [INFO] | +- org.apache.commons:commons-crypto:jar:1.0.0:compile
  [INFO] | | +- org.codehaus.janino:commons-compiler:jar:3.0.8:compile
  [INFO] | | \- commons-lang:commons-lang:jar:2.6:compile
  [INFO] | +- commons-codec:commons-codec:jar:1.11:compile
  [INFO] | | \- org.apache.commons:commons-collections4:jar:4.2:compile
  [INFO] | +- org.apache.commons:commons-exec:jar:1.3:compile
  [INFO] | +- commons-io:commons-io:jar:2.6:compile
  [INFO] | +- org.apache.commons:commons-csv:jar:1.5:compile
  </code></pre>