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

error while running sbt assembly : sbt deduplication error

I am facing the exact issue as described in the below post and the suggested answer is not helping. sbt-assembly: deduplication found error [error] (*:assembly) deduplicate: different file contents found in the following: [error]…
Siva
  • 1,839
  • 5
  • 21
  • 31
3
votes
3 answers

Why is the error "Not a valid command: assembly-merge-strategy"?

I have the following build.sbt file. import AssemblyKeys._ name := "approxstrmatch" version := "1.0" scalaVersion := "2.10.4" libraryDependencies+="org.apache.spark" %% "spark-core" % "1.0.0" resolvers += "AkkaRepository" at…
user3803714
  • 5,269
  • 10
  • 42
  • 61
3
votes
1 answer

How to generate resources for task?

For my Runtime configuration, I can define an extra resourceGenerator as follows: resourceGenerators in Runtime <+= myResourceGeneratingTask For the assembly task this does not work: resourceGenerators in assembly <+= myResourceGeneratingTask The…
Arnout Engelen
  • 6,709
  • 1
  • 25
  • 36
3
votes
1 answer

sbt-assembly: Rename Class with merge conflicts (shade)

How can I tell sbt-assembly to keep its existing merge / deduplicate rules, except, when two .class files conflice, rename (and issue a warning so I know about it)? Would this be identical to the shade strategy used in Maven?
SRobertJames
  • 8,210
  • 14
  • 60
  • 107
3
votes
2 answers

How to build deb package to contain single assembly jar with sbt-assembly and sbt-native-packager?

Is it possible to use the sbt-assembly and sbt-native-packager plugins to create a java application archetype installation that instead of having the project jar and its dependencies in /lib contains just the assembly jar? I've built a Spark…
dkorz
  • 31
  • 3
3
votes
1 answer

SBT - Is there a way to ignore duplicate mappings in copyResources?

I am trying to generate a fat jar using SBT and sbt-assembly. As a requirement, there are other unmanaged resources (directories) that I need to add in the jar. The problem is there are files on 2 directories that have the same file name and path.…
3
votes
1 answer

How to use sbt-assembly and sbt-aws-plugin together? (jarFile setting vs task conflict)

The example given at https://github.com/philcali/sbt-aws-plugin is as follows: awsSsh.scripts += NamedSshScript("deploy", execute = { sshClient => val jar = "~/" + (jarName in assembly).value val assemblyJar = (outputPath in…
user3180279
  • 133
  • 4
3
votes
1 answer

SBT assembly issue: found String required sbt.Task[String] with <<= syntax

I'm a long-term and happy user of sbt-assembly, but I've encountered a problem when using SBT 0.13.0 & sbt-assembly 0.10.1 on a new project. I have previously used code like this: import sbtassembly.Plugin._ import AssemblyKeys._ lazy val…
Alex Dean
  • 15,575
  • 13
  • 63
  • 74
3
votes
1 answer

Dependency issue with Scalding and Hadoop with sbt-assembly

I'm trying to build a far with sbt of a simple hadoop job I'm trying to run in an attempt to run it on Amazon EMR. However when I run sbt assembly I get the following error: [error] (*:assembly) deduplicate: different file contents found in the…
tshauck
  • 20,746
  • 8
  • 36
  • 36
3
votes
1 answer

Suppress main class in sbt-assembly

In a multi-project SBT build, how should one explicitly suppress the mainClass attribute in SBT-assembly? I've searched extensively but cannot seem to find out how to prevent a main class from being set in the jar built by sbt-assembly in a…
Ben Sidhom
  • 1,548
  • 16
  • 25
3
votes
2 answers

sbt-assembly and multiple class defs in dependencies

Being new to sbt and the sbt-assembly plugin I am confused about how one deals with builds involving different class definitions within dependencies I am trying to package. [error] (*:assembly) deduplicate: different file contents found in the…
awfulHack
  • 857
  • 1
  • 10
  • 25
2
votes
0 answers

SBT Provided dependencies are not excluded with assembly

I am new to sbt. I have a quite simple project config as follow: ThisBuild / version := "0.1.0-SNAPSHOT" ThisBuild / scalaVersion := "2.12.15" assemblyMergeStrategy in assembly := { case PathList("META-INF", _*) => MergeStrategy.discard case _…
Ming Gai
  • 21
  • 1
2
votes
1 answer

SBT assembly output 0xEFBFBD instead of 0xCAFEBABE in class file

Tools Version OS Win10 JavaJDK 11 Scala 2.13.5 SBT 1.3.13 Assembly 2.1.0 The repository of sbt-assembly The Error message. I run assembly in sbt shell and it prints [success]. Then I try to run the output .jar with java -jar…
Bean
  • 23
  • 4
2
votes
0 answers

SBT Dynamic Project Dependency

I recently need to integrate some projects as submodules, and each of them has its own build.sbt. And there are also dependencies between submodules. Therefore, I need to dynamically convert the libraryDependencies to dependsOn format. The project…
2
votes
1 answer

Akka config not being found with sbt assembly + serverless

I am trying to build an app for serverless using sbt assembly. It works if I compile it using sbt assembly and then run it using serverless invoke local --function func, however if I run it using serverless offline start it will throw an error…