Skip to content

A tiny plugin to provide a MergeStrategy for those pesky Log4j2Plugins.dat files

License

Notifications You must be signed in to change notification settings

mpollmeier/sbt-assembly-log4j2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sbt-assembly-log4j2

Problem: When including several projects that include log4j2 plugins, sbt-assembly will encounter multiple versions of the Log4j2Plugins.dat cache file that it won't be able to reconcile.

Solution: Log4j2 provides a PluginCache class that creates consistent, serialisable cache from multiple different ones.

This plugin provides a simple function to merge those files in a safe way.

Usage (sbt 1.3+)

project/plugins.sbt:

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.1")
addSbtPlugin("com.michaelpollmeier" % "sbt-assembly-log4j2" % "1.1.3")

build.sbt

assembly/assemblyMergeStrategy := {
  case "META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat" =>
    sbtassembly.Log4j2MergeStrategy.plugincache
}

Latest version of sbt-assembly: see https://github.com/sbt/sbt-assembly#setup

Credits

About

A tiny plugin to provide a MergeStrategy for those pesky Log4j2Plugins.dat files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 100.0%