Skip to content

Instantly share code, notes, and snippets.

@mattkohl
Created November 22, 2016 12:42
Show Gist options
  • Save mattkohl/ef901fcf11f4e5d1c6d1c878b61e5b15 to your computer and use it in GitHub Desktop.
Save mattkohl/ef901fcf11f4e5d1c6d1c878b61e5b15 to your computer and use it in GitHub Desktop.
assemblyMergeStrategy in assembly := {
case x if Assembly.isConfigFile(x) =>
MergeStrategy.concat
case PathList(ps @ _*) if Assembly.isReadme(ps.last) || Assembly.isLicenseFile(ps.last) =>
MergeStrategy.rename
case PathList("META-INF", xs @ _*) =>
xs map {_.toLowerCase} match {
case ("manifest.mf" :: Nil) | ("index.list" :: Nil) | ("dependencies" :: Nil) =>
MergeStrategy.discard
case ps @ (x :: xs) if ps.last.equals("pom.properties") || ps.last.equals("pom.xml") =>
MergeStrategy.discard
case ps @ (x :: xs) if ps.last.equals("io.netty.versions.properties") =>
MergeStrategy.first
case ps @ (x :: xs) if ps.last.equals("libnetty-transport-native-epoll.so") =>
MergeStrategy.first
case ps @ (x :: xs) if ps.last.endsWith(".sf") || ps.last.endsWith(".dsa") =>
MergeStrategy.discard
case "plexus" :: xs =>
MergeStrategy.discard
case "services" :: xs =>
MergeStrategy.filterDistinctLines
case ("spring.schemas" :: Nil) | ("spring.handlers" :: Nil) =>
MergeStrategy.filterDistinctLines
case _ => MergeStrategy.deduplicate
}
case PathList("com", "esotericsoftware", "minlog", xs @ _*) => MergeStrategy.first
case PathList("com", "google", "common", "base", xs @ _*) => MergeStrategy.first
case PathList("javax", "xml", xs @ _*) => MergeStrategy.first
case PathList(ps @ _*) if ps.last endsWith "UnusedStubClass.class" => MergeStrategy.first
case PathList("org", "apache", "commons", xs @ _*) => MergeStrategy.first
case PathList(ps @ _*) if ps.last endsWith "package-info.class" => MergeStrategy.first
case _ => MergeStrategy.deduplicate
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment