How to exclude module from all dependencies but leave explicit declaration Gradle

I am trying to solve the problem,

I have some dependencies declared in build.gradle file for my android app, but the problem is that a lot of these dependencies use the same compat library, in my case appcompat-v7.
It is possible to exclude this library for each dependency

compile ('com.github......'){
    exclude group: '', module: 'appcompat-v7'

But I need to do this in for each dependency
Another way is to use such expression

configurations {
    compile.exclude module: 'appcompat-v7'

This works, but even If declare this library explicitly it is ignored compile ''

All what I need it is to include this library only once for the whole app, because if compile without exclude it will show a lot of errors like has been already defined.
Maybe there is an easier way to get this working. I would be grateful for any help, thanks.