It’s dead-simple in Maven to get rid of certain artifacts in its repository cache.
For example, if I’d like to just remove every artifact with a groupId of ‘de.huxhorn.*’ I’d simply execute ‘rm -rf ~/.m2/repository/de/huxhorn’.
The Gradle cache at ‘~/.gradle/caches’ is a bit more complex than that so I wouldn’t dare to manually interfere with it.
Is there a simple way to achieve a similar result? One that would still work with future Gradle versions, ideally a task that would just tell Gradle itself to get rid of the unwanted artifacts?
The rationale for this is that I’d like to cache ~/.gradle in a Travis build, but without risking a polluted cache. Therefore I’d like to make sure that previously produced artifacts are removed from the cache while keeping artifacts that are simply downloaded.