sbt-assembly

Adding vendor information to MANIFEST.MF using sbt-assembly

我怕爱的太早我们不能终老 提交于 2019-12-06 22:54:24
问题 I'm using sbt-assembly to create a runnable jar, but my application crashes because jai imageio loads the vendor name from the MANIFEST.MF file. If I manually edit the META-INF/MANIFEST.MF file from: Manifest-Version: 1.0 Main-Class: myMainClass to Implementation-Vendor: foo Implementation-Title: bar Implementation-Version: 1.0 Manifest-Version: 1.0 Main-Class: myMainClass Everything works fine. How do I configure sbt or sbt-assembly to include that additional implementation information in

sbt switch dependencies for runtime

≯℡__Kan透↙ 提交于 2019-12-06 11:37:12
I am developing a spark application which is using xgboost4j. https://github.com/dmlc/xgboost/tree/master/jvm-packages This package requires to be compiled to the local architecture due to local C dependencies of the jar. But the cluster has a different architecture than the development laptop. How can I substitute the package when running sbt assembly via one from the cluster? Or would you suggest to solve this via a % "provided" ? Use suffix for (provided/compile) libs as like: val suffix = Option(System getProperty "provided").isDefined match { case true => "provided" case false => "compile

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

陌路散爱 提交于 2019-12-06 06:11:46
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 NoSuchMethodError s at runtime. I've tried to shade guava myself in my build.sbt : val HadoopVersion = "2.6.0-cdh5.11.0" // ... val hadoopHdfs = "org.apache.hadoop" % "hadoop-hdfs" % HadoopVersion val hadoopCommon = "org.apache.hadoop" % "hadoop-common" % HadoopVersion val hadoopHdfsTest = "org.apache.hadoop" % "hadoop-hdfs" % HadoopVersion % "test" classifier "tests" val

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

天大地大妈咪最大 提交于 2019-12-05 22:08:50
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? The rename strategy literally just renames the file and it doesn't change the contents, so it won't work for .class files. The main use case for rename is for LICENSE files. Updated in September 2015 : sbt-assembly 0.14.0 adds shading support. sbt-assembly can shade classes from your projects or from the library dependencies. Backed by Jar Jar Links, bytecode

How to “package” some modules to jars and others to wars in multi-module build with single task?

為{幸葍}努か 提交于 2019-12-05 19:22:41
I use package task (from xsbt-web-plugin ) to package a project to a war, and assembly task (from sbt-assembly ) to package the project to a jar. I have a multi-module build and some modules are packaged into wars and some into jars. I'd like to set up the build to execute assembly task and: Jar modules are packaged into jar files War modules are packaged into war files How to execute package task for the war projects while executing assembly task? Both package task and assembly task evaluate to File type, so as @James commented you should be able to rewire assembly task in webapp project to

Should sbt-assembly perform a “maven-shade-plugin”-like relocation of classes?

房东的猫 提交于 2019-12-05 09:36:42
The description of sbt-assembly merge strategy called rename sounded like it might permit something similar to the shading operation of the maven-shade-plugin which will relocate classes and their references to permit the management of incompatible versions of libraries. Would it be appropriate for sbt-assembly to perform that function? I used the following merge strategy to attempt to use rename as a relocation mechanism but while it matches all the files, it passes them straight through (which is consistent with looking at the code). assemblyMergeStrategy in assembly := { s => s match { case

sbt-assembly: How do I exclude the configuration files in src/main/resources

岁酱吖の 提交于 2019-12-05 02:27:12
问题 I am using sbtassembly from https://github.com/sbt/sbt-assembly to package my project. I'm wondering is there anyway to exclude the resource files? 回答1: You can specify files (and paths) to exclude by customizing the mergeStrategy : https://github.com/sbt/sbt-assembly#excluding-specific-files So for discarding specific file you can do something like this: // build.sbt assemblyMergeStrategy in assembly := { case PathList("about.html") => MergeStrategy.discard case x => val oldStrategy =

sbt-assembly include test classes

蓝咒 提交于 2019-12-04 12:45:05
I follow sbt-assembly : including test classes from a config described in https://github.com/sbt/sbt-assembly that work ok doing assembly When I load sbt I get assembly.sbt:5: error: reference to jarName is ambiguous; it is imported twice in the same scope by import sbtassembly.AssemblyKeys._ and import _root_.sbtassembly.AssemblyPlugin.autoImport._ jarName in (Test, assembly) := s"${name.value}-test-${version.value}.jar" ^ So, I comment import line and run sbt:assembly but that begin the test but dont generate any -test- .jar. Any one know how to generate the jar that include the test classes

java.lang.NoSuchMethodError: akka.actor.ActorCell.addFunctionRef

戏子无情 提交于 2019-12-04 12:43:50
I am trying to setup a simple akka-http 2.4.2 project to test it out, but I am failing to do so. My built.sbt: import NativePackagerHelper._ lazy val akkaVersion = "2.4.2" lazy val root = (project in file(".")). settings( name := "akkTest", version := "0.1", scalaVersion := "2.11.7") libraryDependencies ++= Seq( "com.typesafe.akka" %% "akka-actor" % akkaVersion, "com.typesafe.akka" %% "akka-http-spray-json-experimental" % akkaVersion ) enablePlugins(JavaServerAppPackaging) my code snippet in Main.scala import akka.http.scaladsl.Http import akka.stream.ActorMaterializer import akka.stream

Merge Strategy in sbt assembly and missing application loader

喜欢而已 提交于 2019-12-04 08:58:28
I have a Play web app that I am working on and I would like to be able to deploy it as a fat jar using sbt assembly. While running the application in debug i have no problems with guice library being recognized as it is added in my build.sbt file: libraryDependencies += guice . I have created my sbt assembly MergeStrategy configuration and ran sbt assembly and successfully compiled the jar file for the project, However when i attempt to run the jar i get the following Exception in console: Oops, cannot start the server. java.lang.RuntimeException: No application loader is configured. Please