A shadow plugin transformer implementation for log4j to concatenate Log4j2Plugins.dat files.
This is a port of the maven-shaded-log4j-transformer.
The version numbering scheme is has the following format: SHADOW_MAJOR
.MINOR
.PATCH
. This is no real semantic versioning because the SHADOW_MAJOR version number correspond to the MAJOR shadow plugin version number.
At the time of writing, the latest shadow plugin version was 2.0.0
. Therefore, you should use this plugin's version starting with 2
.
If you are stuck at version 1.2.4
use the plugin version starting with 1
.
The latest plugin version is 2.1.1
. It requires at least Java 7.
You can get version notifications on bintray:
This plugin must work with the shadow plugin and will use Log4j 2.
You can use this plugin as library or gradle plugin.
The plugin can be used as library to provide the Log4j 2 transformer. This is as easy as shown below:
buildscript {
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:2.0.0"
classpath 'de.sebastianboegl.gradle.plugins:shadow-log4j-transformer:2.1.1'
}
}
apply plugin: 'com.github.johnrengelman.shadow'
shadowJar {
transform(de.sebastianboegl.gradle.plugins.shadow.transformers.Log4j2PluginsFileTransformer)
}
The plugin applies the latest version of the shadow plugin or the one in the dependency block, hence, you don't have to apply the shadow plugin.
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:2.0.0"
classpath "de.sebastianboegl.gradle.plugins:shadow-log4j-transformer:2.1.1"
}
}
apply plugin: "de.sebastianboegl.shadow.transformer.log4j"
The order of the plugins doesn't matter:
plugins {
id "com.github.johnrengelman.shadow" version "2.0.0"
id "de.sebastianboegl.shadow.transformer.log4j" version "2.1.1"
}
There is no configuration needed. The plugin adds itself as Transformer (see the shadow plugin documentation Section Controlling JAR Content Merging).