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
3
votes
2 answers

Why does sbt assembly in Spark project fail with "Please add any Spark dependencies by supplying the sparkVersion and sparkComponents"?

I work on a sbt-managed Spark project with spark-cloudant dependency. The code is available on GitHub (on spark-cloudant-compile-issue branch). I've added the following line to build.sbt: "cloudant-labs" % "spark-cloudant" % "1.6.4-s_2.10" %…
Chris Snow
  • 23,813
  • 35
  • 144
  • 309
3
votes
1 answer

Spring boot with sbt: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory

I have packaged my spring boot application using sbt assembly and when trying to run the jar I receive Application startup failed org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is …
cscan
  • 3,684
  • 9
  • 45
  • 83
3
votes
1 answer

SBT multiproject can't locate logback extension

I have a multi project SBT build where the common project contains a logback related extension, while logback.xml is placed in a global resource folder. I have a structure as below, but when running the application (App) it is not applying…
LK__
  • 6,515
  • 5
  • 34
  • 53
3
votes
1 answer

How to shade a dependency for a non-executable Scala Library?

Spent a few hours trying to figure out how to do this. Over the course of it I have looked at a few seemingly promising questions but none of them seem to quite fit what I'm doing. I've got three library jars, let's call them M, S, and H. Library M…
EdgeCaseBerg
  • 2,761
  • 1
  • 23
  • 39
3
votes
0 answers

sbt-launch.jar failed - Could not load main class

I have a jenkins build to check sbt, which is failing with the below error: [sbt-check] $ /var/hudson/tools/java1.8.0_51/bin/java /var/hudson/tools/sbt-0.13.12/bin/sbt-launch.jar -Dsbt.log.noformat=true -jar clean assembly Error: Could not find or…
devops
  • 1,121
  • 5
  • 20
  • 50
3
votes
1 answer

How to produce jar with sbt assembly without scala dependency

I have simple sbt project with one java class without scala dependency: package com.example; class Hello { public static void main(String[] args) { System.out.println("Hello World"); } } And build.sbt: name :=…
zella
  • 4,645
  • 6
  • 35
  • 60
3
votes
2 answers

Fail to override Assembly Merge Strategy in multi-jvm node test

I am having trouble overriding the merge strategy for a dependency. The problem stems from the cassandra dependency rely on separate netty modules val akkaCassandra = "com.typesafe.akka" %% "akka-persistence-cassandra" % "0.17" If I run the…
user1187135
3
votes
1 answer

How to use SBT to run ScalaTest tests against a fat jar?

I have a simple SBT project, consisting of some Scala code in src/main/scala and some test code in src/test/scala. I use the sbt-assembly plugin to create a fat jar for deployment onto remote systems. The fat jar includes all the dependencies of the…
anelson
  • 2,569
  • 1
  • 19
  • 30
3
votes
1 answer

How do I modify the output directory of jar generated by sbt assembly

I am using sbt-assembly to create an executable jar. I was wondering, how do I modify the output directory of jar generated by sbt assembly? By default, the generated jar is in /path/target/scala-2.11/. I want to change this to not include the scala…
dade
  • 3,340
  • 4
  • 32
  • 53
3
votes
1 answer

How to exclude META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA' in sbt

I have created jar from Intellij for spark+ scala code and try to run the jar in the dev cluster, But I end up with the following error: Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main…
Bhaskar
  • 271
  • 7
  • 20
3
votes
0 answers

sbt-assembly deduplicate class

I'm getting the following error between different versions of joda-time, one loaded by elastic search, the other loaded by the current module (and also other modules). java.lang.RuntimeException: deduplicate: different file contents found in the…
scc
  • 10,342
  • 10
  • 51
  • 65
3
votes
1 answer

Rename file using sbt-assembly

I have a scala project that uses the ConfigFactory to set up the application configurations. For building I use sbt (together with sbt-assembly). Depending on whether I create an assembly with sbt-assembly or whether I just run the project, I would…
navige
  • 2,447
  • 3
  • 27
  • 53
3
votes
0 answers

sbt assembly, dependencies and sub-projects

I have created a sbt (v.0.13.8) project with some sub-project (I have a good reason for this, see Apache Spark and gRPC). What I would like to have is a root project few sub-projects have at least one of the sub-projects create a jar file that is…
navige
  • 2,447
  • 3
  • 27
  • 53
3
votes
5 answers

java.lang.NoSuchMethodError: akka.actor.ActorCell.addFunctionRef

I am trying to setup a simple akka-http 2.4.2 project to test it out, but I am failing to do so. My built.sbt: import NativePackagerHelper._ lazy val akkaVersion = "2.4.2" lazy val root = (project in file(".")). settings( name :=…
Saif
  • 57
  • 1
  • 7
3
votes
0 answers

Error with Ivy: sbt assembly java.lang.AssertionError java.lang.IllegalStateException

I installed spark 1.6.0, java 1.8.0_73 and sbt 0.13.9 on my Mac (El Capitan) When I type sbt assembly I get the following error. [error] (sql/compile:compile) java.lang.AssertionError: assertion failed: List(object package$DebugNode, object…
MKR
  • 51
  • 5