yale
yale

Reputation: 41

Force to download dependencies from repository but only for particular package

I am looking for a way to force to download only dependencies from particular package in Gradle (which comes from my company only and changing very often) instead of redownloading everything.

I know how to redownload everything by executing

./gradlew build --refresh-dependencies

or by

rm -rf $HOME/.gradle/caches/

but is there any option to limits dependencies to download? All of them have the same prefix com.company.*

Thanks!

Upvotes: 1

Views: 134

Answers (1)

Cisco
Cisco

Reputation: 23070

You can not control which dependency to refresh with --refresh-dependencies, it's not designed for that.

You will need specify a rich version for the changing dependencies. Then configure Gradle's caching of dynamic/rich versions to your liking:

dependencies {
    implementation("com.company:my-library:latest.release")
}

configurations.all {
    resolutionStrategy.cacheChangingModulesFor 0, "seconds"
}

Upvotes: 2

Related Questions