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

How do I publish a fat JAR (JAR with dependencies) using sbt and sbt-release?

I need to build a single jar, including dependencies, for one of my sub-projects so that it can be used as a javaagent. I have a multi-module sbt project and this particular module is the lowest level one (it's also pure Java). Can I (e.g. with…
fommil
  • 5,757
  • 8
  • 41
  • 81
15
votes
2 answers

SBT assembly jar exclusion

Im using spark (in java API) and require a single jar that can be pushed to the cluster, however the jar itself should not include spark. The app that deploys the jobs of course should include spark. I would like: sbt run - everything should be…
user2843110
  • 177
  • 1
  • 1
  • 6
14
votes
1 answer

how to shade before compile with SBT?

Our project mainly consists of two parts Build.scala where the root project lies BuildShaded.scala where some external dependencies are shaded with sbt-assembly. The shaded jars will be depended upon by sub projects under the root project through…
manuzhang
  • 2,995
  • 4
  • 36
  • 67
14
votes
4 answers

Sbt-assembly unresolved dependency, Scala

I'm installing Sbt-Assembly, but am now stuck. Sbt Version (from 'sbt about'): 0.13.8 Current project is built against scala 2.11.6 Sbt, sbt plugins, and build definitions are using Scala 2.10.4 project/assembly.sbt addSbtPlugin("com.eed3si9n"…
user2827214
  • 1,191
  • 1
  • 13
  • 32
14
votes
3 answers

scala sbt assembly "no main manifest attribute"

I use assembly plugin in sbt to assemble my project. But errors happen when run by "java -jar xx.jar" - "no main manifest attribute". I think it's because there are two files in my src/main/scala/ directory and each with an object extending…
hl1020
  • 529
  • 5
  • 11
14
votes
2 answers

What is a classifier in SBT

What is meant under the term classifiers? Is it comes from Jars? For example in sbt-assembly plugin: artifact in (Compile, assembly) ~= { art => art.copy(`classifier` = Some("assembly")) }
user1078671
13
votes
2 answers

spark + sbt-assembly: "deduplicate: different file contents found in the following"

I ran spark application and wanna pack the test classes into the fat jar. What is weird is I ran "sbt assembly" successfully, but failed when I ran "sbt test:assembly". I tried sbt-assembly : including test classes, it didn't work for my case. SBT…
Grant
  • 500
  • 1
  • 5
  • 18
13
votes
3 answers

Where to find sbt-assembly in artifacts repositories online?

I'm running sbt 0.13.0 and have a project with sbt-assembly via: addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2") Upon executing sbt assembly I get the following message: [info] Resolving com.eed3si9n#sbt-assembly;0.11.2 ... [warn] module…
bruce szalwinski
  • 724
  • 1
  • 8
  • 27
13
votes
3 answers

How can a duplicate class be excluded from sbt assembly?

We have a situation in which two dependencies have exactly the same class (because one of the dependencies copied it and included in their own source). This is causing sbt assembly to fail its deduplication checks. How can I exclude a class from a…
Channing Walton
  • 3,977
  • 1
  • 30
  • 59
13
votes
1 answer

sbt-assembly : including test classes

As part of sbt-assembly I want to include both src and test class files in jar. Sbt-assembly includes only src files with dependencies. Is there any way through which I can include test classes also in same jar?
Anuj Mehta
  • 1,072
  • 3
  • 13
  • 25
13
votes
1 answer

Getting sbt-assembly working

So thus far I've been compiling my Scala project with SBT (via Typesafe stack). I want to run the code across several machines now, via sbt-assembly. Following directions, the only one change I made was in my project/Build.scala file. Here is the…
adelbertc
  • 7,270
  • 11
  • 47
  • 70
12
votes
1 answer

sbt assembly shading to create fat jar to run on spark

I'm using sbt assembly to create a fat jar which can run on spark. Have dependencies on grpc-netty. Guava version on spark is older than the one required by grpc-netty and I run into this error: java.lang.NoSuchMethodError:…
12
votes
2 answers

Why does sbt assembly fail with "Not a valid command: assembly"?

I installed Spark to C:\Spark1_6\spark-1.6.0-bin-hadoop2.6. After navigating to this path I am entering sbt assembly command and I am getting the following error message: [error] Not a valid command: assembly [error] Not a valid project ID:…
kiran
  • 121
  • 1
  • 1
  • 4
12
votes
3 answers

Custom outputPath for sbt-assembly

I have multi-project Build.scala. Is there a way to place all jars generated by sbt-assembly in the root target directory? For example, consider the following: lazy val root = Project("root", file(".")).aggregate(hello) lazy val hello = Project(id…
user2597851
  • 121
  • 1
  • 4
12
votes
3 answers

sbt assembly error - deduplicate: different file contents found in the following

I get the following error when I do a ./sbt assembly on my Scala project. I saw the first after adding these dependencies to my build.sbt I can compile and run my code. libraryDependencies ++= Seq( "org.scalanlp" % "breeze_2.10" % "0.7", …
Soumya Simanta
  • 11,523
  • 24
  • 106
  • 161
1
2
3
35 36