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

Verify shading in sbt-assembly IntelliJ

I'm trying to use GeoIP2 v2.10.0 Java API (https://github.com/maxmind/GeoIP2-java) with Apache Spark v2.2.0, Scala 2.11.8. The problem is, Apache Spark has jackson-databind artifact v2.6.5 in it's pom file where as the GeoIP2 requires a miniumum…
Sai Kiriti Badam
  • 950
  • 16
  • 15
5
votes
1 answer

sbt assembly with integration test

Hi i have an SBT build file that handles Integration test within our organization, the test themselves work and i can run separately unit and it test. However when packaging the app with sbt-assembly i am not able to run both test sequentially (unit…
user145634
  • 125
  • 7
5
votes
3 answers

Scala + SBT - How to configure reference.conf for a shaded Akka library

TL;DR I am trying to shade a version of the akka library and bundle it with my application (to be able to run a spray-can server on the CDH 5.7 version of Spark 1.6). The shading process messes up akka's default configuration, and after manually…
Johan Hirsch
  • 557
  • 4
  • 21
5
votes
1 answer

SBT - Multi project merge strategy and build sbt structure when using assembly

I have a project that consists of multiple smaller projects, some with dependencies upon each other, for example, there is a utility project that depends upon commons project. Other projects may or may not depend upon utilities or commons or neither…
null
  • 3,469
  • 7
  • 41
  • 90
5
votes
1 answer

SBT: How to set transitive dependencies of a dependency to "provided" later?

I have something like this in my build.sbt: lazy val someDeps = Seq( libraryDependencies += "com.example" %% "foo" % "1.3.37", // more ) lazy val some_library = project.in(file("libs/somelibrary")). settings(commonSettings). settings( …
rabejens
  • 7,594
  • 11
  • 56
  • 104
5
votes
1 answer

Proper way to make a Spark Fat Jar using SBT

I need a Fat Jar with Spark because I'm creating a custom node for Knime. Basically it's a self-contained jar executed inside Knime and I assume a Fat Jar is the only way to spawn a local Spark Job. Eventually we will go on submitting a job to a…
Chobeat
  • 3,445
  • 6
  • 41
  • 59
5
votes
3 answers

Is it possible to use json4s 3.2.11 with Spark 1.3.0?

Spark has a dependency on json4s 3.2.10, but this version has several bugs and I need to use 3.2.11. I added json4s-native 3.2.11 dependency to build.sbt and everything compiled fine. But when I spark-submit my JAR it provides me with…
5
votes
1 answer

Should sbt-assembly perform a "maven-shade-plugin"-like relocation of classes?

The description of sbt-assembly merge strategy called rename sounded like it might permit something similar to the shading operation of the maven-shade-plugin which will relocate classes and their references to permit the management of incompatible…
Traveler
  • 1,048
  • 14
  • 27
5
votes
1 answer

Parboiled2 causes "missing or invalid dependency detected while loading class file 'Prepender.class'"

So I've been trying to use parboiled2 for the last few weeks now, it is possibly the most difficult dependency to add to a build I have come across in my entire life. My current error is a compile sbt assembly) error: [error] missing or invalid…
samthebest
  • 30,803
  • 25
  • 102
  • 142
5
votes
1 answer

Hadoop depends on two different versions of beanutils

Hadoop 2.4.0 depends on two different versions of beanutils, causing the following error with sbt-assembly: [error] (*:assembly) deduplicate: different file contents found in the following: [error]…
SRobertJames
  • 8,210
  • 14
  • 60
  • 107
5
votes
2 answers

sbt publish assembly jar with a pom

I am able to build one of my multi-project's jars as a single jar and then publish it How do I publish a fat JAR (JAR with dependencies) using sbt and sbt-release? However, the associated pom.xml is not published with it. How can I create and…
fommil
  • 5,757
  • 8
  • 41
  • 81
5
votes
2 answers

SBT: How to publish both the aggregate project and all modules on Sonatype?

I have a SBT project which I was publishing to Sonatype with no issue and I converted it to a multi-module SBT project. Now I want to: publish the jar/javadoc/sources/pom file containing all the aggregated submodules to Sonatype (meaning that they…
Eric
  • 15,494
  • 38
  • 61
5
votes
1 answer

sbt-assembly: How do I include the static files in src/main/webapp

I am using sbtassembly from https://github.com/sbt/sbt-assembly with this merge strategy: mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) => { case PathList("javax", "servlet", xs @ _*) => MergeStrategy.first case…
James Black
  • 41,583
  • 10
  • 86
  • 166
4
votes
0 answers

sbt assembly assemblyShadeRules not shading dependency

I am trying to shade com.google.gson to my_gson and added assemblyShadeRules to my build.sbt: assemblyShadeRules in assembly ++= Seq( ShadeRule.rename("com.google.gson.**" -> "my_gson.@1") .inLibrary("com.google.code.gson" % "gson" % "2.8.9") …
stephen
  • 51
  • 2
4
votes
1 answer

sbt-assembly: Logback does not work with über-JAR

If I run the application within IntelliJ, logging works fine, but if I run the über-JAR, I get the following error: LF4J: No SLF4J providers were found. SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See…
Hannes
  • 5,002
  • 8
  • 31
  • 60