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

evict specific transitive dependency in sbt

Suppose a small test project (sbt 0.13.8, full project as gist): name := "test" organization := "org.example" version := "0.1.0-SNAPSHOT" scalaVersion := "2.11.6" libraryDependencies ++= Seq ( "com.lowagie" % "itext" %…
Urist McDev
  • 498
  • 3
  • 14
4
votes
4 answers

unresolved dependency org.apache.spark#spark-network-common_2.10 while building spark 1.2.0

With sbt version 0.13.6, rof@railsonfire_1ad6bd90-94b5-0132-e2d9-5692d74b909b_7f496a9f21bf:~/bin/spark$ sbt/sbt --version Using /usr/lib/jvm/java-7-openjdk-amd64/ as default JAVA_HOME. Note, this will be overridden by -java-home if it is set. sbt…
prayagupa
  • 30,204
  • 14
  • 155
  • 192
4
votes
1 answer

Scala code build with sbt assembly , failing

I am using sbt 0.13.7 and Scala 2.11.4 on a Windows machine to compile my code into a fat jar, that I eventually want to run on a Linux machine. Below is my build.sbt file: import AssemblyKeys._ name := "Simple Project" version :=…
Varun
  • 93
  • 1
  • 8
4
votes
1 answer

How can I run tests against jar built by sbt-assembly

I'm running sbt-assembly in order to build a single jar file that can be deployed elsewhere. I would like to run my tests against this jar file rather than against the local .class files. Running against the local .class files is the default with…
TooTone
  • 7,129
  • 5
  • 34
  • 60
4
votes
1 answer

SBT Scala Assembly Plugin

How to enable Assembly plugin on my repo. https://github.com/rmuhamedgaliev/skala-skeleton i tried fix them. But can't run this with command sbt assembly] assembly [error] Not a valid command: assembly [error] Not a valid project ID: assembly …
Rinat Mukhamedgaliev
  • 5,401
  • 8
  • 41
  • 59
4
votes
2 answers

Resolving Dependencies in creating JAR through SBT assembly

I want to create a big Jar file. for which am trying to use SBT ASSEMBLY. I installed sbt-assembly from GitHub and this answer. When I ran sbt assembly, I got this error: java.lang.RuntimeException: deduplicate: different file contents found in the…
Learner
  • 1,685
  • 6
  • 30
  • 42
4
votes
1 answer

How to remove an artifact from publish

For publishing i'm using sbt-assembly, but the problem is that on publish it publishes all artifacts, which i don't need, i what just the one which is generated with assembly task. How can i remove artifacts from packagedArtifacts setting?
user1078671
4
votes
1 answer

Passing external arguments to sbt jar (created via sbt-assembly)

I have created an assembly jar project based on https://github.com/sbt/sbt-assembly and wish to load "logback.xml" and "application.conf" externally which overrides both the default files packaged in the fatjar. Something similiar to this java…
conikeec
  • 209
  • 2
  • 14
3
votes
1 answer

How to create executable single jar which include webapp resources by sbt-assembly with scalatra

I'm making webapp using scalatra framework via sbt & xsbt-web-plugin. I want to package all resources(templates, css, js) into a single jar. In sbt with sbt-assembly plugin, assembly command makes single jar which includes all of project's…
pokutuna
  • 71
  • 5
3
votes
1 answer

Include scala source files in sbt pack output jar

How can the scala source files of a project be included in the generated target jar produced by sbt pack? Currently, when an IDE user of my jar tries to jump to a function in the library they will only get decompiled version of the code instead of…
Ramón J Romero y Vigil
  • 17,373
  • 7
  • 77
  • 125
3
votes
1 answer

How do you specify/figure out which minimum JDK is required for running the fat jar?

I used sbt-assembly on a project where I have some java 14 jars, and my local machine has JDK 8 as the default JDK. The sbt assembly task was successful and produced a fat jar. When I run it with JDK 8, I get the error: Exception in thread "main"…
karanveer41
  • 221
  • 1
  • 2
  • 6
3
votes
1 answer

How to force adding provided dependency to fat jar using sbt-assembly plugin?

I have a Spark project which I usually package with sbt-assembly. All spark dependencies are marked provided and not included in my fat jar. I want to have another command to build a really fat jar with all dependencies, spark included. I am trying…
Kal-ko
  • 317
  • 1
  • 10
3
votes
1 answer

What does the sbt assembly documentation mean by "already part of the container?"

I am running into the deduplicate error in sbt assembly trying to package my multiproject spark job. I looked in the sbt assembly documentation, and it says If you're trying to exclude JAR files that are already part of the container (like Spark),…
user3685285
  • 6,066
  • 13
  • 54
  • 95
3
votes
3 answers

sbt-assembly deduplicate error with org.apache.arrow

I am using sbt 1.2.8 and sbt-assembly 0.14.9. I'm trying to build a fat JAR for my project that uses Spark + Akka + gRPC. I had many deduplication errors at first; I managed solved all but 1, and I couldn't find a way to solve this one for…
smddzcy
  • 443
  • 4
  • 19
3
votes
1 answer

sbt shading two versions of a dependency

When I run my tests I see the following error: Exception: java.lang.NoSuchMethodError: fs2.Stream$.bracket(Ljava/lang/Object;Lscala/Function1;Lscala/Function1;)Lfs2/internal/FreeC; I first made sure my build file was cleaned up by explicitly…
codenoodle
  • 982
  • 6
  • 19