解决log4j2配置不起作用
1、所有的配置都正确,启动项目,发现log4j加载失败



2、在poi的build标签下添加一段代码
<plugins>
<plugin>
<groupId>org.basepom.maven</groupId>
<artifactId>duplicate-finder-maven-plugin</artifactId>
<version>1.1.0</version>
<executions>
<execution>
<id>default</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>false</skip>
<quiet>false</quiet>
<checkCompileClasspath>true</checkCompileClasspath>
<checkRuntimeClasspath>true</checkRuntimeClasspath>
<checkTestClasspath>true</checkTestClasspath>
<failBuildInCaseOfDifferentContentConflict>false</failBuildInCaseOfDifferentContentConflict>
<failBuildInCaseOfEqualContentConflict>false</failBuildInCaseOfEqualContentConflict>
<failBuildInCaseOfConflict>false</failBuildInCaseOfConflict>
<printEqualFiles>false</printEqualFiles>
<preferLocal>true</preferLocal>
<!-- Version 1.1.1+ -->
<includeBootClasspath>false</includeBootClasspath>
<bootClasspathProperty>sun.boot.class.path</bootClasspathProperty>
<!-- Version 1.1.1+ -->
<!-- Version 1.2.0+ -->
<includePomProjects>false</includePomProjects>
<!-- Version 1.2.0+ -->
</configuration>
</plugin>
</plugins>

3、然后在项目上右键-run as-run configurations,找到maven,右键,新建

4、分别输入名称和地址

5、在goals中输入duplicate-finder:check

6、点击apply-run,在控制台我们看到了有冲突的包以及冲突类

7、activemq包里与log4j的api冲突,我们删除activemq,换用无冲突的依赖包

8、再次启动项目,哈哈,可以看到日志信息出来了
