scalaVersion := "2.12.12"
name := "hello-world"
version := "1.0"
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "2.1.1"
libraryDependencies += "org.apache.logging.log4j" % "log4j-core" % "2.17.1"
assembly / assemblyMergeStrategy := {
// As an example, keep services but discard all the rest
case PathList("META-INF", "services", xs @ _*) => MergeStrategy.first
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case x => MergeStrategy.first
}
// Randomly shade something - if your remove this, the issue is not re-produced
assembly / assemblyShadeRules := Seq(
ShadeRule.rename("scala.collection.compat.**" -> "shadecompat.@1").inAll
)
In the produced hello-world-assembly-1.0.jar file \META-INF\services\javax.annotation.processing.Processor is empty.
To my point of view this is bug, because that file is not empty in the originating log4j-core-2.17.1.jar.
To "fix" this issue, I can either change the plugin version to an older one, like 0.14.10, or remove the shading rules.
Additonal files: In my project that produces an 160MB .jar file, I have the same issue with META-INF\org.apache.logging.log4j.util.PropertySource. Interestingly, other javax.* or org.apache.logging.log4j.* files are correctly included.
Hello,
to reproduce I create a simple sbt project with.
sbt new scala/hello-world.g8
Any sbt-assembly version >= 1.0.0 has the issue.
In the
build.sbt
:In the produced
hello-world-assembly-1.0.jar
file\META-INF\services\javax.annotation.processing.Processor
is empty.To my point of view this is bug, because that file is not empty in the originating
log4j-core-2.17.1.jar
.To "fix" this issue, I can either change the plugin version to an older one, like
0.14.10
, or remove the shading rules.Additonal files: In my project that produces an 160MB .jar file, I have the same issue with
META-INF\org.apache.logging.log4j.util.PropertySource
. Interestingly, otherjavax.*
ororg.apache.logging.log4j.*
files are correctly included.