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
8
votes
1 answer

How much of a jar file gets loaded into the memory

I am programming with scala, when I write a simple "println("hello world")" program and use 'sbt package' to publish it into a jar file the file is only 4kb in size but that doesn't help me since the jar file won't run without the scala library. So…
CodeChief
  • 81
  • 1
8
votes
1 answer

Speeding up SBT-assembly

We have a project where we are building a large number of Scalatra microservices by packaging them using the sbt-assembly plugin, then creating Docker images using the sbt-docker plugin. The process is slow due to the number of micro-services…
Mark Butler
  • 4,361
  • 2
  • 39
  • 39
7
votes
1 answer

Create assembly jar that contains all tests in SBT project+subprojects

I have an interesting problem where I basically need to create a .jar (plus all of the classpath dependencies) that contains all of the tests of an SBT project (plus any of its subprojects). The idea is that I can just run the jar using java -jar…
mdedetrich
  • 1,899
  • 1
  • 18
  • 29
7
votes
5 answers

sbt assembly error:deduplicate: different file contents found in io.netty.versions.properties

I have added the following jar to build.sbt file as follows: "com.amazonaws" % "aws-java-sdk" % "1.11.492" Post this ,during merge , I am getting the following error : [error] 1 error was encountered during merge java.lang.RuntimeException:…
Kishori
  • 141
  • 2
  • 9
7
votes
1 answer

KryoException: Unable to find class with spark structured streaming

1-The Problem I have a Spark program that make use of Kryo but not as part of the Spark Mechanics. More specifically I am using Spark Structured Streaming connected to Kafka. I read binary values coming from Kafka and decode it on my own. I am…
MaatDeamon
  • 9,532
  • 9
  • 60
  • 127
7
votes
4 answers

SBT: How to package an instance of a class as a JAR?

I have code which essentially looks like this: class FoodTrainer(images: S3Path) { // data is >100GB file living in S3 def train(): FoodClassifier // Very expensive - takes ~5 hours! } class FoodClassifier { // Light-weight API…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
7
votes
0 answers

SBT skipping tests in all subprojects

In order to run assembly without tests, it's recommended to run: sbt 'set test in assembly := {}' clean assembly But when we have a multi-project setup, this doesn't work. I have to do things like sbt 'set test in assembly in sub1 := {}' 'set test…
husrevo
  • 331
  • 2
  • 6
7
votes
1 answer

How to build jar from play framework 2.5.x

I try to build jar from clean project with sbt-assembly how describes in docs: addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2") import AssemblyKeys._ assemblySettings mainClass in assembly :=…
zella
  • 4,645
  • 6
  • 35
  • 60
7
votes
2 answers

SBT Assembly not working (not a valid command)

I have tried a lot of solutions that I could find related to this topic. Above all of them, sbt assembly command not found looked the most related, but that did not solve it. I am using sbt 13.7 build.sbt: lazy val commonSettings = Seq( …
lbollar
  • 1,005
  • 1
  • 10
  • 17
7
votes
0 answers

Play Java 2.3.8 deduplicate on sbt-assembly

The question: why is it ignoring the MergeStrategy.first? I've made a minor application within the Play Framework using version 2.3.8 According to the official documentation you can add the line addSbtPlugin("com.eed3si9n" % "sbt-assembly" %…
Fraek
  • 93
  • 6
7
votes
1 answer

DeDuplication error with SBT assembly plugin

I am trying to create an executable jar using SBT assembly plugin. I am ending up with below error : [error] (app/*:assembly) deduplicate: different file contents found in the following: [error]…
Rajeev
  • 4,762
  • 8
  • 41
  • 63
7
votes
2 answers

sbt assembly task runs slowly after adding some dependencies

I'm kind of new to deployment in scala and I configured the sbt-assembly plugin, all worked well. Some days ago I added hadoop, spark and some other dependencies, then the assembly task become extremely slow (8 to 10 minutes) and before that, it was…
darkjh
  • 2,821
  • 7
  • 35
  • 43
6
votes
1 answer

Scala sbt assembly jar does not work (class implementation not found) but code works when through IntelliJ

When launching my code with scala -cp assembly.jar class.A --config-path confFile I get java.lang.IllegalStateException: No LivyClientFactory implementation was found But when launching through IntelliJ it works just fine. Also I checked inside my…
Yassine
  • 123
  • 3
6
votes
1 answer

Spark can't find the application class itself (ClassNotFoundException) in spark-submit with SBT assembly JAR

Background I am trying to get started with Spark using Scala. Originally, I was trying to write a streaming Kinesis consumer, following along with this official example. Although, at this point I have reduced my error case to remove anything Kinesis…
Ming
  • 1,613
  • 12
  • 27
6
votes
3 answers

Merge Strategy in sbt assembly and missing application loader

I have a Play web app that I am working on and I would like to be able to deploy it as a fat jar using sbt assembly. While running the application in debug i have no problems with guice library being recognized as it is added in my build.sbt file:…
mox_mox
  • 111
  • 2
  • 10