Skip to content

Instantly share code, notes, and snippets.

@hacktrick
Last active December 14, 2021 12:19
Show Gist options
  • Save hacktrick/5db575c4bc2f11626885cb8166ab299b to your computer and use it in GitHub Desktop.
Save hacktrick/5db575c4bc2f11626885cb8166ab299b to your computer and use it in GitHub Desktop.
Maven Enforcer Plugin - enforce Log4J 2 >= 2.15.0
...
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>enforce-safer-logging</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<!-- https://cwiki.apache.org/confluence/display/MAVENOLD/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges -->
<bannedDependencies>
<!-- banned -->
<excludes>
<exclude>log4j:log4j</exclude><!-- ban Log4J 1.x -->
<exclude>org.apache.logging.log4j:*:(,2.15.0)</exclude><!-- ban Log4J lt 2.15.0 -->
</excludes>
</bannedDependencies>
</rules>
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment