Gradle dependecies issues

I am using this compile group: ‘org.springframework’, name: ‘spring-core’, version:‘4.3.10.RELEASE’ in one of my gradle build script but still I am getting 5.1 version in my war file which I do not need. Please help me on this. Dependencies tree showing version 5.1 but I want only 4.3.10 versions jars.

You can use the dependencyInsight task to help determine what is causing version 5.1 to be pulled in. For example,

./gradlew dependencyInsight --dependency spring-core

Add --configuration xyz if you need to look at a specific configuration.