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