Background/Situation
When opening an existing project that requires indexing, IntelliJ IDEA starts pulling log4j 1.2.12 into the .m2/repository.
It looks like this dependency is not declared anywhere in the project’s pom.xml.
Question
Using IntelliJ IDEA 2025.3, but observed the same behavior in earlier versions as well.
What might be causing this?
Answer
It could be a transitive dependency from a Maven/Gradle plugin, test utility, or auxiliary indexing/import component that is causing Maven Resolver to fetch log4j:log4j:1.2.12 during the project’s sync/indexing phase, even though the project's pom.xml doesn’t declare it directly. To confirm where it comes from, check the following:
- Run
mvn -q dependency:tree -Dincludes=log4j:log4jto see if any module or plugin in the reactor brings it in transitively. If the project is multi-module, run it per module to catch scope-specific pulls (tests/build plugins). This helps prove it’s not in the effective project dependencies if the tree is empty for the main modules, and highlights plugins/tests if present. - Check .
m2/repository/org/apache/log4j/log4j/1.2.x/_remote.repositoriesto see which repository entry wrote it and when. The timestamp helps correlate with the indexing/import moment. - If the project also uses Gradle in the repo, run
gradle dependencies | grep -i log4jto ensure no Gradle-side tool pulls it. There have been mixed repositories where Gradle parts influence the IDE’s setup/import and trigger unexpected resolutions. - Search the build scripts for “indexing-server”, legacy test utilities, or older logging bridges that could pull Log4j 1.x transitively, especially in test/buildSrc/integration-test folders. Prior issues show those as common sources.
If nothing above applies collect the logs by going to Help | Collect Logs and Diagnostic Data, contact support and attach the zip file in the ticket or through the JetBrains secure upload site https://uploads.jetbrains.com/, and share the uploadID.
Comments
0 comments
Please sign in to leave a comment.