mvn rewrite:dryRun
. This won't make changes to the project's files. It will produce a rewrite.patch
file in the reports directory, with a link in the console log:rewrite.patch
file, which reveals all of the dependencies that transitively depend on logback.com.yourorg.UseSlf4jSimple
recipe as active in your pom.xml:mvn rewrite:dryRun
again to preview the changes that will be made and mvn rewrite:run
to apply the changes.mvn rewrite:dryRun
only produces warnings in the console output and a rewrite.patch
file if there are active recipes that would make changes. This means dryRun
can be used in your CI pipeline to prevent new logback-classic dependencies from being added going forward. Configure the CI step to fail if dryRun
emits any warnings to the console log, or if a rewrite.patch
file is produced, and you have an effective guard against regression.mvn rewrite:run
before the build & test step. Then the build won't need to fail because rewrite will automatically fix the dependency problem.