Skip to content

Instantly share code, notes, and snippets.

@madchap
Created December 16, 2021 15:38
Show Gist options
  • Save madchap/4b60b885e40260b50fdcd84df835136d to your computer and use it in GitHub Desktop.
Save madchap/4b60b885e40260b50fdcd84df835136d to your computer and use it in GitHub Desktop.
maven dependency version enforcer
<!-- 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") and CVE-2021-45046 -->
...
<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.16.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