Questions tagged [sbt-assembly]
sbt-assembly is an sbt plugin for building a single JAR file of a project.
175
questions with no upvoted or accepted answers
7
votes
0
answers
840
views
SBT skipping tests in all subprojects
In order to run assembly without tests, it's recommended to run:
sbt 'set test in assembly := {}' clean assembly
But when we have a multi-project setup, this doesn't work. I have to do things like
...
7
votes
0
answers
648
views
Play Java 2.3.8 deduplicate on sbt-assembly
The question: why is it ignoring the MergeStrategy.first?
I've made a minor application within the Play Framework using version 2.3.8
According to the official documentation you can add the line ...
6
votes
0
answers
1k
views
FatJar from sbt-assembly throw java.lang.NoClassDefFoundError
I'm trying to execute a fat jar builded with sbt-assembly using spark and deepLearning4J, unfortunately during execution i'm confronted to the Exception in thread "main" java.lang.NoClassDefFoundError:...
6
votes
0
answers
238
views
Assembly dependency as part of multi-module sbt build
I have a multi module sbt project, e.g.:
lazy val core = (project in file("my-project-core"))
.settings(name := "my-project-core")
// more settings
lazy val app = (project in file("my-project-app"))
...
6
votes
1
answer
2k
views
Using Maven's shade plugin from Scala and sbt
Due to some quirks in some dependencies, I'm having trouble with sbt-assembly, and have been told that people working with Java and have had good results with Maven's shade plugin.
How can I use ...
6
votes
1
answer
597
views
Add sources to sbt assembly
I am using sbt assembly to create a library, for internal purposes.
I am publishing this jar to a local artifactory installation, and it works nicely.
However, I still haven't figured out how to add ...
5
votes
0
answers
465
views
Why won't sbt-assembly shade json4s using inLibrary?
Using sbt-assembly 0.14.6:
addSbtPlugin("com.eed3si9n" %% "sbt-assembly" % "0.14.6")
Creating an uber jar for a Spark app with sbt-assembly, including a couple dependencies to be shaded:
...
5
votes
1
answer
810
views
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 ...
5
votes
1
answer
1k
views
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"...
4
votes
0
answers
257
views
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.**" -> "...
4
votes
0
answers
1k
views
SBT Assembly publish fat jar to Nexus
I'm trying to push a fat jar generated by sbt-publish to a private Nexus repository. So, in my Nexus, I've created two repositories, one hosting snapshots version and one hosting releases artifacts.
...
4
votes
1
answer
434
views
sbt-assembly shading error with shapeless in ubuntu
I’m having a weird issue with sbt-assembly if anyone could help
When trying to create fat jar to deploy to Spark with shading applied to shapeless libraries, I am seeing some classes not being ...
4
votes
0
answers
379
views
Spring-boot plugin for sbt
My goal is to package an executable spring-boot jar - a web app with tomcat embedded. I would like to use sbt but I don't find a straight forward way to do this. There are maven and gradle spring-boot ...
4
votes
1
answer
417
views
SBT Assembly Plugin on signed jar files
We had a scala application which was being built by command sbt dist this uses the native packager to create a zip file and dumps all the jar files imported by SBT into the zip file.
This worked for ...
4
votes
1
answer
1k
views
How do I use the sbt-native-packager with multiple projects
I am in the process of merging several large scala projects into one. Currently they share code using cut and paste (not very much code) and I am making it so that there is a common utilities jar. ...
4
votes
0
answers
191
views
How to make two build SBT-ASSEMBLY, using two different config file, within the same project
I'm working on a scala project and i'm trying to make two kind of build (test and prod).
I have two application.conf files ( test and prod) and I wonder how two different SBT assembly tasks that use ...
4
votes
1
answer
3k
views
Java OutOfMemoryError on sbt assembly
I tried to launch sbt assembly with some library dependencies.
When I tried to add
"edu.stanford.nlp" % "stanford-corenlp" % "3.5.1",
"edu.stanford.nlp" % "stanford-corenlp" % "3.5.1" classifier "...
4
votes
1
answer
871
views
Spark job SBT Assembly merge conflict when including Spark Streaming Kinesis ASL library
I started making a spark streaming job and got a producer up for kinesis endpoint. After getting that working I started making a consumer but I ran into problems with building it.
I am using the ...
4
votes
1
answer
1k
views
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 ...
3
votes
1
answer
1k
views
Sbt assembly - Multiple jars with different Main classes from single project
I have a project with this structure:
--resources
--src
|
|-- mypackage.main
|
|-- MainClassOne.scala
|-- MainClassTwo.scala
...
3
votes
1
answer
878
views
sbt-assembly exclude dependsOn dependencies
I have a project with a few subprojects, and many dependencies, One subproject will have most development (app) and generating the full jar takes time. So I want to split the fat-jar generation into 2 ...
3
votes
0
answers
637
views
Deduplicate: different file contents sbt-assembly
I have a multi-project built with sbt, and I would like to build an executable jar using sbt-assembly plugin. However, I get an error while building the jar file:
[error] deduplicate: different file ...
3
votes
1
answer
1k
views
Repository for publishing is not specified in multi-modules project with docker sbt
I am trying to deploy a multi-modules project using an sbt-docker plugin. I want to create separate containers for api and app modules and to skip other modules. However, every time I run docker: ...
3
votes
0
answers
204
views
How to bundle integration tests into jar so they can be run with scalatest runner
I can run integration tests in sbt using it:test. I would like to assemble my integrations tests into a fat jar so other users can run them with the ScalaTest runner org.scalatest.tools.Runner and not ...
3
votes
1
answer
938
views
Spring boot with sbt: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory
I have packaged my spring boot application using sbt assembly and when trying to run the jar I receive
Application startup failed
org.springframework.context.ApplicationContextException: Unable to ...
3
votes
0
answers
620
views
sbt-launch.jar failed - Could not load main class
I have a jenkins build to check sbt, which is failing with the below error:
[sbt-check] $ /var/hudson/tools/java1.8.0_51/bin/java /var/hudson/tools/sbt-0.13.12/bin/sbt-launch.jar -Dsbt.log.noformat=...
3
votes
1
answer
2k
views
How to exclude META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA' in sbt
I have created jar from Intellij for spark+ scala code and try to run the jar in the dev cluster, But I end up with the following error:
Exception in thread "main" java.lang.SecurityException: ...
3
votes
0
answers
772
views
sbt-assembly deduplicate class
I'm getting the following error between different versions of joda-time, one loaded by elastic search, the other loaded by the current module (and also other modules).
java.lang.RuntimeException: ...
3
votes
0
answers
662
views
sbt assembly, dependencies and sub-projects
I have created a sbt (v.0.13.8) project with some sub-project (I have a good reason for this, see Apache Spark and gRPC).
What I would like to have is a
root project
few sub-projects
have at least ...
3
votes
0
answers
126
views
Error with Ivy: sbt assembly java.lang.AssertionError java.lang.IllegalStateException
I installed spark 1.6.0, java 1.8.0_73 and sbt 0.13.9 on my Mac (El Capitan)
When I type sbt assembly I get the following error.
[error] (sql/compile:compile) java.lang.AssertionError: assertion ...
3
votes
0
answers
88
views
how to make sbt-assembly case sensitive
my project uses an un-managed fat jar file.
on this file there are some classes that differ only by the case
for instance it might have ABC.class and Abc.class
when I use sbt-assembly it outputs ...
3
votes
2
answers
549
views
How should we address local dependencies in sbt files for Spark
I have this sbt file:
offline := true
name := "hello"
version := "1.0"
scalaVersion := "2.11.7-local"
scalaHome := Some(file("/home/ubuntu/software/scala-2.11.7"))
libraryDependencies += "org.apache....
3
votes
1
answer
2k
views
Spark RDD Class not Found
I am new to Spark and need help with the error:
java.lang.NoClassDefFoundError: org/apache/spark/rdd/RDD$
I am creating a standalone Spark example in Scala. I ran sbt clean package and sbt assembly ...
3
votes
3
answers
3k
views
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"
...
3
votes
1
answer
269
views
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
...
2
votes
0
answers
25
views
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 :=...
2
votes
0
answers
49
views
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 ...
2
votes
1
answer
57
views
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 ...
2
votes
0
answers
230
views
How to shade packages inside a fat jar depdency
I've an SBT project that depends on
"com.google.cloud.bigdataoss" % "gcs-connector" % "hadoop3-2.2.2"
which is bringing a recent version of google-api-services-storage.
...
2
votes
0
answers
329
views
Flink ML - java.lang.ClassNotFoundException: org.apache.flink.ml.math.DenseVector
When submitting a job to my Flink 1.8.1 cluster, it fails with the following exception:
java.lang.ClassNotFoundException: org.apache.flink.ml.math.DenseVector
However, the mentioned class seems to ...
2
votes
1
answer
1k
views
ClassNotFoundException: net.logstash.log4j.JSONEventLayoutV1 in assembled Spark jar file
I am running Spark application from jar file. When I define in log4j custom file and run my application simply from the main class the logs output works fine, however, when I run the application from ...
2
votes
0
answers
398
views
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 ...
2
votes
1
answer
437
views
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 (...
2
votes
0
answers
348
views
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 ...
2
votes
0
answers
740
views
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 ...
2
votes
0
answers
821
views
sbt build issue - IO error while decoding code.scala with UTF-8
I am trying to sbt assembly my code (script.scala) on my Windows 7 machine using cmd, and I am getting the above posted error.
I have also tried to set this on cmd
JAVA_TOOL_OPTIONS='-Dfile.encoding=...
2
votes
0
answers
397
views
SBT generates a $global directory that suspends sbt assembly
We're using SBT 0.13.13 with SBT assembly 0.14.3
Lately, sbt assembly started getting stuck when trying to read some XML files. After some digging we found out it happens because SBT generates a ...
2
votes
0
answers
338
views
Geotools JAI fatjar causing problems in native dependencies
I have a scala project using geotools / JAI dependencies in order to process ESRi ASCII Grid files to WKT in java. When deploying a fat-jar, I get a SIGSEV in the native part of the jai code.
It is ...
2
votes
2
answers
2k
views
unresolved dependency: com.eed3si9n#sbt-assembly;0.13.0: not found
Did lots of search, saw many people having the similar issue and tried various suggested solution. None worked.
Can someone help me?
resolvers += Resolver.url("bintray-sbt-plugins", url("http://dl....
2
votes
0
answers
831
views
ScalaPB and shading with SBT isn't working
I'm trying to get https://scalapb.github.io/">ScalaPB to work with Spark. In order to do this I need to shade my protocol buffers within SBT using code like below
assemblyShadeRules in assembly := ...