The build project encountered an error because the company configured the check rule in Super-bom:
[ERROR] [XXX Enforcer Rules] Find duplicateclasses
Found in:
Org.apache.logging.log4j:log4j-slf4j-impl:jar:2.6.2:compile
Ch.qos.logback:logback-classic:jar:1.1.7:compile
Duplicate classes:
Org/slf4j/impl/staticmdcbinder.class
Org/slf4j/impl/staticmarkerbinder.class
Org/slf4j/impl/staticloggerbinder.class
I did not directly quote Logback-classic in the POM, see this error is ignorant, I did not quote this in the Pom ah.
Resolution process:
It is possible to find out which package is dependent on Logback-classic by IntelliJ Idea's package dependency. Operation: View->tool window->maven Projects, this button:
You can see the package dependency graph, which may be more complex and messy, and can be searched after Ctrl+f:
This blog has mentioned how to deal with this problem: http://blog.csdn.net/xudan1010/article/details/ 52890102, that is, use excusions to exclude spring-boot-starter dependence on spring-boot-starter-logging, and then introduce Log4j-slf4j-impl
<dependency> <groupId>org.springframework.boot</groupId> <artifactId> spring-boot-starter</artifactid> <exclusions> <exclusion> <groupId> Org.springframework.boot</groupid> <artifactId>spring-boot-starter-logging</artifactId> </exclusion> </exclusions> </dependency>
You can also use commands to see dependencies: MVN dependency:tree | grep log
Resolving conflicts between Spring-boot-starter-logging and log4j