How can I exclude a transitive dependency from compile but not runtime? For example I would like to prevent commons logging from being used in our code, but some transitive dependencies (such as Spring Framework) require it.
I tried using
configurations { compile.exclude group: 'commons-logging', module: 'commons-logging' }
but that excludes it from runtime also.