Closed fbaierl closed 5 years ago
I found a way to achieve this:
OsgiKeys.embeddedJars := (Keys.externalDependencyClasspath in Compile).value.map(_.data).filter(
file => {
/*
* Find configs for file and return false if it includes "test" or "provided"
*/
libraryDependencies.value.map(x => { (x.name.toLowerCase, x.configurations.map(_.toLowerCase)) })
.find { case (n, _) => file.getName.toLowerCase.contains(n) }
.flatMap {case (_, c) => c} match {
case x if x.contains("test") => false
case x if x.contains("provided") => false
case _ => true
}
})
Is there a way to create a fat jar using the
OsgiKeys.embeddedJars
attribute, but to exclude libraries that are marked as "Provided", like e.g.:In this case
com.typesafe.akka
should be included in the fat jar whileorg.apache.logging.log4j
should not be compiled into the jar.