I personally consider excluding / subtracting to be a hacky practice and always try to avoid it if possible. In this case you may accidentally subtract a transitive dependency that’s in two configurations. Are you sure there’s not a solution to group your dependencies into configurations and only add together what you need for a given scenario?
Also, are you aware of the compileOnly configuration added in gradle 2.12?