Skip to content

Instantly share code, notes, and snippets.

@sfilyh
Forked from gunnarmorling/banning-log4j2.pom.xml
Created December 11, 2021 12:31
Show Gist options
  • Select an option

  • Save sfilyh/d5514226a93e7619f82bbd1a53a96159 to your computer and use it in GitHub Desktop.

Select an option

Save sfilyh/d5514226a93e7619f82bbd1a53a96159 to your computer and use it in GitHub Desktop.
<!-- plug-in configuration to put into your parent POM for avoiding any usages of outdated log4j2 versions,
some of which are subject to the RCE CVE-2021-44228 ("Log4Shell") -->
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>ban-bad-log4j-versions</id>
<phase>validate</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>org.apache.logging.log4j:log4j-core:(,2.15.0)</exclude>
</excludes>
</bannedDependencies>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment