sbt-assembly

Running an uber jar from sbt assembly results in error: Could not find or load main class

為{幸葍}努か 提交于 2019-12-03 17:03:22
问题 I have a spark job packaged as an uber-jar using the sbt assembly plugin. The build.sbt specifies a runnable main to be the target of the resulting uber-jar mainClass in assembly := Some("com.foo.Bar") After the assembly is correctly created, running the intended command: java -jar assembly.jar results in Error: Could not find or load main class com.foo.Bar Using the an alternative method, like java -cp assembly.jar com.foo.Bar gives the same error message. Then, I extracted the contents of

Why Maven assembly works when SBT assembly find conflicts

断了今生、忘了曾经 提交于 2019-12-03 12:48:19
The title could also be: What are the differences between Maven and SBT assembly plugins. I have found this to be an issue, while migrating a project from Maven to SBT. To describe the problem I have created an example project with dependencies that I found to behave differently, depending on the build tool. https://github.com/atais/mvn-sbt-assembly The only dependencies are (sbt style) "com.netflix.astyanax" % "astyanax-cassandra" % "3.9.0", "org.apache.cassandra" % "cassandra-all" % "3.4", and what I do not understand is, why mvn package creates the fat jar successfully, while sbt assembly

How can I add unmanaged JARs in sbt-assembly to the final fat JAR?

こ雲淡風輕ζ 提交于 2019-12-03 10:32:21
My project has dependencies on a JAR file that isn't in Ivy, how can I include it directly in the final JAR output by sbt-assembly ? Figured out I just have to add them explicitly as unmanaged dependencies in Build.scala , they are not automatically pulled in from the lib folder. Adding this line to settings worked: unmanagedJars in Compile += file("lib/vertica_jdk_5.jar") For a single project setup, putting jars into lib should work. If you have multi-project setup the lib directory would be under each subproject like app/lib . Just an update for those searching unmanaged dependencies:

libraryDependencies for com.eed3si9n#sbt-assembly;0.13.0: not found

回眸只為那壹抹淺笑 提交于 2019-12-03 06:27:23
I am building a sbt plugin and want to reference assembly task in the sbt-assembly plugin ( to be dependent on my task) to do this i need to reference it as a library ( as opposed to a plugin), and somehow sbt is not able to resolve it as a libraryDepdendencies this is what my sbt looks like sbtPlugin := true name := "my-sbt-plugin" scalaVersion := "2.10.6" sbtVersion := "0.13.0" resolvers ++= Seq(Resolver.sbtPluginRepo("releases"), Resolver.sbtPluginRepo("snapshots")) libraryDependencies ++= Seq( "com.eed3si9n" % "sbt-assembly" % "0.13.0") the output looks like Resolving com.eed3si9n#sbt

spark sbt compile error libraryDependencies

冷暖自知 提交于 2019-12-02 09:05:01
问题 1.2.0-bin-hadoop2.4 and my Scala version is 2.11.7 . I am getting an error so I can't use sbt. ~/sparksample$ sbt Starting sbt: invoke with -help for other options [info] Set current project to Spark Sample (in build file:/home/beyhan/sparksample/) > sbt compile [info] Updating {file:/home/beyhan/sparksample/}default-f390c8... [info] Resolving org.scala-lang#scala-library;2.11.7 ... [info] Resolving org.apache.spark#spark-core_2.11.7;1.2.0 ... [warn] module not found: org.apache.spark#spark

scala sbt assembly “no main manifest attribute”

女生的网名这么多〃 提交于 2019-12-01 04:13:13
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 Application which means there are two main entry in the project. But I need two applications, one is the server and the other is the test client. How to handle this two-main-entry problem in scala sbt. Thanks in advance. In your SBT build file, define the main class. If you are using build.sbt, then that would be: mainClass in assembly := Some("com.domain

how to shade before compile with SBT?

左心房为你撑大大i 提交于 2019-12-01 03:35:52
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 unmanagedJars setting. The question is how to assembly the shaded project before compiling the root project. Otherwise, the root project will fail to compile since those classes in the shaded jars are not available. As I said in the comments, I would take a different route. If you take on the dependencies as managed dependencies , you can shade them

What is a classifier in SBT

时光毁灭记忆、已成空白 提交于 2019-12-01 03:23:47
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")) } classifier is defined by Maven as the fifth element of a project coordinate, after groupId , artifactId , version and packaging . More specifically (from the maven documentation , emphasis mine): The classifier allows to distinguish artifacts that were built from the same POM but differ in their content . It is some optional and arbitrary string that - if present - is appended to the artifact name just

sbt assembly command not found

邮差的信 提交于 2019-11-30 14:28:32
问题 I'm trying to run sbt assembly. According to https://github.com/sbt/sbt-assembly , for sbt 0.13.6+ (I'm on 0.13.7) this should be included automatically for anything with the JvmPlugin. According to sbt plugins I have the JvmPlugin enabled in root. When I run sbt assembly I get "Not a valid commamdn: assembly". I've tried using old methods of including sbt-assembly with all the different types of sbt configurations, but none seem to work. Here's what my build files look like (note sbt package

How to run sbt-assembly tasks from within IntelliJ IDEA?

寵の児 提交于 2019-11-30 13:49:44
问题 Is it possible to run sbt-assembly from within IntelliJ IDEA? Also I read in the doc that one could add task within the SBT Tool window. But what I see is that it only helps you view your project not task? I cannot add any tasks there. How does the Tool window work exactly? I have the last version of IntelliJ IDEA. 回答1: This answer is now out-of-date. IntelliJ now allows you to create a run configuration for an SBT task. You create the Run Configuration by : choosing "Edit configurations"