/maven-shaded-log4j-transformer

Transformer implementation to concatenate Log4j2Plugins.dat files

Primary LanguageJavaApache License 2.0Apache-2.0

License   CodeFactor   GitHub build (v2.17.1)   Test Coverage   Latest Maven Central release   We recommend IntelliJ IDEA

maven-shaded-log4j-transformer

Transformer for maven-shaded-plugin, that concatenates Log4j2Plugins.dat files in order to provide a workaround for LOG4J2-673 and LOG4J2-954 bugs.

How to use:

<project>
...
    <build>
...
        <plugins>
...
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
...
                                <transformer
                                        implementation="io.github.edwgiz.log4j.maven.plugins.shade.transformer.Log4j2PluginCacheFileTransformer">
                                </transformer>
                            </transformers>
...
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>io.github.edwgiz</groupId>
                        <artifactId>log4j-maven-shade-plugin-extensions</artifactId>
                        <version>2.17.1</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>

    </build>

</project>

A number of the transformer version corresponds to the number of the artifacts in org.apache.logging.log4j group

Below versions are available:

  • 2.17.1, ⚠️ the prior transformer declaration in your pom.xml should be rewritten accordingly above example
  • 2.8.1
  • 2.8
  • 2.7
  • 2.6.2
  • 2.6.1
  • 2.1