Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In the end, I couldn't get past duplicate class errors using Proguard, let alone how to figure out how to filter out the relevant jars, so finally switched to a much cleaner <a href="https://github.com/sbt/sbt-assembly" rel="nofollow">sbt-assembly</a> approach:</p> <p>-1. Added the sbt-assembly plugin to my project as per the <a href="https://github.com/sbt/sbt-assembly/blob/master/README.md" rel="nofollow">README</a></p> <p>-2. Updated the appropriate project dependencies with a <code>"provided"</code> flag to stop them being added into my fat jar:</p> <pre><code>val hadoop = "org.apache.hadoop" % "hadoop-core" % V.hadoop % "provided" val hive = "org.apache.hive" % "hive-common" % V.hive % "provided" val serde = "org.apache.hive" % "hive-serde" % V.hive % "provided" val httpClient = "org.apache.httpcomponents" % "httpclient" % V.http val httpCore = "org.apache.httpcomponents" % "httpcore" % V.http val logging = "commons-logging" % "commons-logging" % V.logging % "provided" val specs2 = "org.specs2" %% "specs2" % V.specs2 % "test" </code></pre> <p>-3. Added an sbt-assembly configuration like so:</p> <pre><code>import sbtassembly.Plugin._ import AssemblyKeys._ lazy val sbtAssemblySettings = assemblySettings ++ Seq( assembleArtifact in packageScala := false, jarName in assembly &lt;&lt;= (name, version) { (name, version) =&gt; name + "-" + version + ".jar" }, mergeStrategy in assembly &lt;&lt;= (mergeStrategy in assembly) { (old) =&gt; { case "META-INF/NOTICE.txt" =&gt; MergeStrategy.discard case "META-INF/LICENSE.txt" =&gt; MergeStrategy.discard case x =&gt; old(x) } } ) </code></pre> <p>Then typing <code>assembly</code> produced a "fat jar" with just the packages I needed in it, including the unmanaged dependency and excluding Hadoop/Hive etc.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload