I wanted to remove all direct / transitive dependencies using older log4J version, particularly version 1.27.1 from my project.
I have made sure that my project's pom.xml and lib folder does not contain log4J 1.27.1.
However, whenever the project builds into a .war file, there are some other libraries in my project which is still using log4j 1.27.1 resulting in log4j-1.27.1.jar being downloaded into the build for deployment.
Is there any means we can force the Maven project by preventing it from downloading a specific dependency? For example, by adding some
configurations to the pom.xml file?
Edit 1: Understand that one way to do it is to do exclusions in the pom.xml file. But that requires me to explicitly mention all the artifacts . Is there anyway to do it as though I am stating "hey, I don't want to see log4j-1.27.1.jar downloaded in my Maven project at all, be it any artifact is depending on it" ?