Collision during build and need to ensure jar is not included

I have been debugging this for two days now and still do not know why this is happening, but I did discover if I remove the first instance of /log4j-slf4j-impl-2.11.2.jar my Spring application will run on Tomcat. How do I prevent the file from getting added to the /WEB-INF/lib/* during the build.

Below is the issue

Found binding in [jar:file:/C:Users/uid/apache-tomcat-8.5.30/webapps/appName-!/org/slf4j/impl/StaticLoggerBinder.clss]
Found binding in [jar:file:/C:Users/uid/apache-tomcat-8.5.30/webapps/appName-!/org/slf4j/impl/StaticLoggerBinder.class]

If I rename the file log4j-slf4j-impl-2.11.2.jarBAK I can run the Spring app on Tomcat

I tried the following, but it did not work

tasks.register('delete exclude WEB-INF/lib/log4j-slf4j-impl-2.11.2.jar', Delete){
     delete fileTree("/src".matching{
          include "WEB-INF/lib/log4j-slf4j-impl-2.11.2.jar"

Thanks fellow CoDErs!!!

Dependency conflict between compile groups removed and it fixed the issue.