Sbt-assembly: rename a class with merge conflicts (hue)

How can I say that sbt-assembly retains its existing merge / deduplication rules, except when two .class files collide, rename (and give a warning so I know about it)?

Will this be identical to the shadow strategy used in Maven?

+3
source share
1 answer

The rename strategy literally just renames the file and does not change the contents, so it will not work for .class files. The main use case for renaming is LICENSE files.

Updated in September 2015 :

sbt-assembly 0.14.0 adds shading support.

sbt-assembly can obscure classes from your projects or from library dependencies. With the support of Jar Jar Links, bytecode conversion (via ASM) is used to change references to renamed classes.

 assemblyShadeRules in assembly := Seq( ShadeRule.rename("org.apache.commons.io.**" -> " shadeio.@1 ").inAll ) 
+3
source

Source: https://habr.com/ru/post/1214633/


All Articles