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

Sbt assembly JVM settings

I am just trying to understand the different between next 2 ways of settings JVM parameters while generating jar in scala project using sbt-assembly plugin: // This works fine - no memory issues while building jar set "JAVA_OPTS=-Xms2g -Xmx2g" //…
Pavel
  • 1,519
  • 21
  • 29
2
votes
1 answer

spark-submit fails when case class fields are reserved java keywords with backticks

I have backticks used for reserved keyword. One example for the case class is as follows: case class IPC( `type`: String, main: Boolean, normalized: String, section:String, …
Anish
  • 1,920
  • 11
  • 28
  • 48
2
votes
2 answers

Scala: Sbt can run project, but calling the jar results in ClassNotFoundError

I have a project that will compile/package/run with SBT, but when I call the jar from the command line with Scala, I get a 'java.lang.ClassNotFoundException'. build.sbt: name := "coloring" version := "0.1" scalaVersion :=…
Logister
  • 1,852
  • 23
  • 26
2
votes
1 answer

Rename assembly-generated uberjar in SBT

How to rename and move an uberjar generated with SBT assembly plugin? addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6") My assemblyMergeStrategy(for META-INF removal): assemblyMergeStrategy in assembly := { case PathList("META-INF", xs @…
xmar
  • 1,729
  • 20
  • 48
2
votes
1 answer

sbt assembly merge issue [deduplicate: different file contents found in the following]

I have followed other sbt assembly merge issues in stackoverflow and added merge strategy but still it is not getting resolve. I added dependency tree plugin but it is not showing the dependency of transitive libraries. I have used the latest merge…
donald
  • 478
  • 8
  • 19
2
votes
2 answers

How to pass mainClass argument using sbt assembly

Not sure if its possible but i wish to have several main classes and i don't wish to change sbt.build each time before i run sbt assembly is there a way to pass the mainClass argument while calling assembly ? like: project> assembly -mainClass…
Michal
  • 150
  • 3
  • 13
2
votes
0 answers

how sbt merge strategy really works on deduplicate errors?

I'm new to sbt and sbt-assembly plugin. I tried to build 2 jars from different packages in the scala play project. I read the Merge Strategy section in https://github.com/sbt/sbt-assembly but still don't quite understand how the mapping of path…
David
  • 69
  • 3
  • 7
2
votes
1 answer

Spark: Fat-JAR crashing Zeppelin with NullPointerException

Note: This is NOT a duplicate of Getting NullPointerException when running Spark Code in Zeppelin 0.7.1 I've run into this roadblock in Apache Zeppelin on Amazon EMR. I'm trying to load a fat-jar (located on Amazon S3) into Spark interpreter. Once…
y2k-shubham
  • 10,183
  • 11
  • 55
  • 131
2
votes
0 answers

Sbt ( new version 1.0.4) assembly failure

I have been trying to build fat jar for some time now. I got assembly.sbt in project folder and it looks like below addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6") and my build.sbt looks like below name := "cool" version :=…
ram
  • 31
  • 4
2
votes
1 answer

Why isn't guava being shaded properly in my build.sbt?

tl;dr: Here's a repo containing the problem. Cassandra and HDFS both use guava internally, but neither of them shades the dependency for various reasons. Because the versions of guava aren't binary compatible, I'm finding NoSuchMethodErrors at…
erip
  • 16,374
  • 11
  • 66
  • 121
2
votes
1 answer

shapeless shading in spark not working - method still not found

Currently I face some problems with shapeless in spark 2.1 where still an outdated version of shapeless is being used. One of my dependencies(PureConfig current version of 0.8.0) pulls in a newer version of shapeless. One should be able to…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
2
votes
1 answer

How to exclude libraries from different tasks in sbt?

I have the following project structure: / ├── project | └── ... ├── src | └── ... ├── lib │   ├── prod-lib.jar | └── test-lib.jar └── build.sbt And I need to compile with test-lib.jar for deploying into a testing environment and with…
Camilo Sampedro
  • 1,306
  • 1
  • 19
  • 32
2
votes
1 answer

sbt assembly works, but still "no main manifest attribute"

I am using sbt 1.0.2. My build.sbt is name := "myprogram" version := "0.1" scalaVersion := "2.12.3" libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test" //…
Make42
  • 12,236
  • 24
  • 79
  • 155
2
votes
1 answer

sbt: how to merge multiple jars

Is there a way to use sbt to just merge (assembly) multiple jars in one jar. Let say I have: src (empty) lib/lib1.jar lib/lib2.jar and I want: target/all.jar Maybe there are some other tools to make that for example using zip to aggregate…
Benjamin
  • 3,350
  • 4
  • 24
  • 49
2
votes
0 answers

How to include specific environment specific config file in assembly

I have an sbt project where i am building the jar file by running sbt assembly. The issue is there are different config files based for different environment in the src/main/resources directory. For production it's application-prod.conf and for…
dks551
  • 1,113
  • 1
  • 15
  • 39