I have three Gradle modules: ModA and ModB and ModC
ModA has a dependency on ModB AND Spring Web MVC 3.2.6
ModB has a dependency on ModC
ModC has a dependency on Spring Web MVC 4.1.5
I'm getting quite a few errors because ModA is pulling in and using Spring 4.1.5 instead of 3.2.6. Because of version differences and time I can't update ModA to Spring 4.1.5 right now. What I'd like to do is exclude Spring 4.1.5 from the ModB dependency in the ModA Gradle file, so that only 3.2.6 is pulled in and used; however, everything I've tried hasn't excluded the dependency.
DOESNT WORK: ModA build.gradle:
compile('com.stuff:ModB:+') {
exclude group: 'org.springframework'
}
compile('com.stuff:ModB:+') {
exclude group: 'org.springframework', module: 'spring-webmvc'
}
So, how can I exclude a module from a dependency's dependency? And if this is how I'm supposed to, why might it not be working?