sbt-assembly

sbt assembly: deduplicate module-info.class

拜拜、爱过 提交于 2020-12-29 05:20:13
问题 I get the following error when assembling my uber jar: java.lang.RuntimeException: deduplicate: different file contents found in the following: [error] /Users/jake.stone/.ivy2/cache/org.bouncycastle/bcprov-jdk15on/jars/bcprov-jdk15on-1.61.jar:module-info.class [error] /Users/jake.stone/.ivy2/cache/javax.xml.bind/jaxb-api/jars/jaxb-api-2.3.1.jar:module-info.class I am not up to date with java technology, but assume I cannot simply discard one of these classes. Can someone tell me what

How to work efficiently with SBT, Spark and “provided” dependencies?

大憨熊 提交于 2020-07-31 06:57:20
问题 I'm building an Apache Spark application in Scala and I'm using SBT to build it. Here is the thing: when I'm developing under IntelliJ IDEA, I want Spark dependencies to be included in the classpath (I'm launching a regular application with a main class) when I package the application (thanks to the sbt-assembly) plugin, I do not want Spark dependencies to be included in my fat JAR when I run unit tests through sbt test , I want Spark dependencies to be included in the classpath (same as #1

How to create executable single jar which include webapp resources by sbt-assembly with scalatra

你离开我真会死。 提交于 2020-02-24 09:29:12
问题 I'm making webapp using scalatra framework via sbt & xsbt-web-plugin. I want to package all resources(templates, css, js) into a single jar. In sbt with sbt-assembly plugin, assembly command makes single jar which includes all of project's dependencies. $ java -jar myproject.jar and I open it in browser Could not load resource: [/WEB-INF/views/index.scaml]; are you sure it's within [null]? I unzipped jar to confirm that it does not include src/main/webapp/* . How can I config sbt for

Why Maven assembly works when SBT assembly find conflicts

非 Y 不嫁゛ 提交于 2020-01-22 13:56:08
问题 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",

SBT assembly jar exclusion

*爱你&永不变心* 提交于 2020-01-22 05:51:33
问题 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 compiled and excuted sbt smallAssembly - create a jar without spark sbt assembly - create an uber jar with everything (including spark) for ease of deployment. I have 1. and 3. working. Any ideas on how I can 2. ? What code would I need to add to my

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

血红的双手。 提交于 2020-01-13 16:47:30
问题 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? 回答1: 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