Questions tagged [sbt-assembly]

sbt-assembly is an sbt plugin for building a single JAR file of a project.

sbt-assembly is open-source and is available under the MIT licence.

528 questions
158
votes
4 answers

sbt-assembly: deduplication found error

I am not sure whether mergestrategy or exclude jars is the best option here. Any help with how do I proceed further with this error will be great! [sameert@pzxdcc0151 approxstrmatch]$ sbt assembly [info] Loading project definition from…
user3803714
  • 5,269
  • 10
  • 42
  • 61
56
votes
4 answers

How to fix sbt reporting "Error wrapping InputStream in GZIPInputStream: java.io.EOFException"?

While running sbt command in an empty directory, it keeps failing with the following exception: $ sbt [info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins Error wrapping InputStream in GZIPInputStream: java.io.EOFException at…
Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
43
votes
8 answers

How to work efficiently with SBT, Spark and "provided" dependencies?

I'm building an Apache Spark application in Scala and I'm using SBT to build it. Here is the thing: when I'm developing under IntelliJ IDEA, I want Spark dependencies to be included in the classpath (I'm launching a regular application with a main…
Alexis Seigneurin
  • 1,433
  • 2
  • 15
  • 20
42
votes
2 answers

What are key differences between sbt-pack and sbt-assembly?

I've just stumbled upon the sbt-pack plugin. The development stream seems steady. It's surprising to me as I believed that the only plugin for (quoting sbt-pack's headline) "creating distributable Scala packages." is sbt-assembly (among the other…
Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
41
votes
4 answers

How to add "provided" dependencies back to run/test tasks' classpath?

Here's an example build.sbt: import AssemblyKeys._ assemblySettings buildInfoSettings net.virtualvoid.sbt.graph.Plugin.graphSettings name := "scala-app-template" version := "0.1" scalaVersion := "2.9.3" val FunnyRuntime =…
user2785627
  • 411
  • 1
  • 4
  • 3
37
votes
7 answers

sbt assembly command not found

I'm trying to run sbt assembly. According to https://github.com/sbt/sbt-assembly , for sbt 0.13.6+ (I'm on 0.13.7) this should be included automatically for anything with the JvmPlugin. According to sbt plugins I have the JvmPlugin enabled in root.…
Jonathan Sweetman
  • 605
  • 1
  • 6
  • 16
29
votes
7 answers

assembly-merge-strategy issues using sbt-assembly

I am trying to convert a scala project into a deployable fat jar using sbt-assembly. When I run my assembly task in sbt I am getting the following error: Merging 'org/apache/commons/logging/impl/SimpleLog.class' with strategy 'deduplicate' …
sc_ray
  • 7,803
  • 11
  • 63
  • 100
26
votes
8 answers

Why does Spark application fail with “ClassNotFoundException: Failed to find data source: kafka” as uber-jar with sbt assembly?

I'm trying to run a sample like StructuredKafkaWordCount. I started with the Spark Structured Streaming Programming guide. My code is package io.boontadata.spark.job1 import org.apache.spark.sql.SparkSession object DirectKafkaAggregateEvents { …
benjguin
  • 1,496
  • 1
  • 12
  • 21
24
votes
1 answer

How do you comment a line in .sbt file

This may sound like a stupid question, but I've been searching all over the internet on how to comment a line in an sbt file. Does anyone know how to?
pythonic
  • 20,589
  • 43
  • 136
  • 219
24
votes
1 answer

Multiple executable jar files with different external dependencies from a single project with sbt-assembly

I have a single scala project built with sbt using a build.scala file. I can use sbt-assembly to generate a single executable jar file from this project without problem. Now I want to generate multiple executable jar files, where each file includes…
23
votes
3 answers

sbt assembly: deduplicate module-info.class

I get the following error when assembling my uber jar: java.lang.RuntimeException: deduplicate: different file contents found in the following: [error] …
Jake
  • 4,322
  • 6
  • 39
  • 83
19
votes
3 answers

How can I add unmanaged JARs in sbt-assembly to the final fat JAR?

My project has dependencies on a JAR file that isn't in Ivy, how can I include it directly in the final JAR output by sbt-assembly?
Garrett Hall
  • 29,524
  • 10
  • 61
  • 76
17
votes
1 answer

Running an uber jar from sbt assembly results in error: Could not find or load main class

I have a spark job packaged as an uber-jar using the sbt assembly plugin. The build.sbt specifies a runnable main to be the target of the resulting uber-jar mainClass in assembly := Some("com.foo.Bar") After the assembly is correctly created,…
maasg
  • 37,100
  • 11
  • 88
  • 115
15
votes
2 answers

What means "xs @ _*" in PathList of SBT assembly-plugin?

What these phrases mean: xs @ _* ps @ _* Copied from documentation: assemblyMergeStrategy in assembly := { case PathList("javax", "servlet", xs @ _*) => MergeStrategy.first case PathList(ps @ _*) if ps.last endsWith ".html" =>…
Aleks Ya
  • 859
  • 5
  • 15
  • 27
15
votes
2 answers

How to run sbt-assembly tasks from within IntelliJ IDEA?

Is it possible to run sbt-assembly from within IntelliJ IDEA? Also I read in the doc that one could add task within the SBT Tool window. But what I see is that it only helps you view your project not task? I cannot add any tasks there. How does the…
MaatDeamon
  • 9,532
  • 9
  • 60
  • 127
1
2 3
35 36