I’m having a weird issue with sbt-assembly
if anyone could help
When trying to create fat jar to deploy to Spark with shading applied to shapeless
libraries, I am seeing some classes not being renamed when ran in an Ubuntu machine while everything gets renamed fine when the sbt assembly
is ran in Mac.
Here’s the shading config
assemblyShadeRules in assembly := Seq(
ShadeRule.rename("shapeless.**" -> "shadedshapeless.@1")
.inLibrary("com.chuusai" % "shapeless_2.11" % "2.3.2")
.inLibrary("com.github.pureconfig" % "pureconfig_2.11" % "0.7.0")
.inProject)
When ran in Mac, these classes are renamed for pattern shapeless/Generic*
Renamed shapeless/Generic$.class -> shadedshapeless/Generic$.class
Renamed shapeless/Generic.class -> shadedshapeless/Generic.class
Renamed shapeless/Generic1$.class -> shadedshapeless/Generic1$.class
Renamed shapeless/Generic1$class.class -> shadedshapeless/Generic1$class.class
Renamed shapeless/Generic1.class -> shadedshapeless/Generic1.class
Renamed shapeless/Generic10$class.class -> shadedshapeless/Generic10$class.class
Renamed shapeless/Generic10.class -> shadedshapeless/Generic10.class
Renamed shapeless/Generic1Macros$$anonfun$1.class -> shadedshapeless/Generic1Macros$$anonfun$1.class
Renamed shapeless/Generic1Macros$$anonfun$2.class -> shadedshapeless/Generic1Macros$$anonfun$2.class
Renamed shapeless/Generic1Macros.class -> shadedshapeless/Generic1Macros.class
Renamed shapeless/GenericMacros$$anonfun$23.class -> shadedshapeless/GenericMacros$$anonfun$23.class
Renamed shapeless/GenericMacros.class -> shadedshapeless/GenericMacros.class
but when ran in Ubuntu, for the pattern shapless/Generic*
only these things are renamed
Renamed shapeless/GenericMacros$$anonfun$23.class -> shadedshapeless/GenericMacros$$anonfun$23.class
Renamed shapeless/Generic1Macros$$anonfun$1.class -> shadedshapeless/Generic1Macros$$anonfun$1.class
Renamed shapeless/Generic1$.class -> shadedshapeless/Generic1$.class
Renamed shapeless/Generic1.class -> shadedshapeless/Generic1.class
I chose the pattern shapeless/Generic*
coz when am providing the fat jar (produced in Ubuntu) to spark-submit
then am getting the error right away (probably coming from pureconfig
)
Exception in thread "main" java.lang.NoClassDefFoundError: shadedshapeless/Generic
No error occurs when fat jar produced in Mac is being fed to spark-submit