How can I force gradle to redownload dependencies?

Generally, you can refresh dependencies in your cache with the command line option –refresh-dependencies. You can also delete the cached files under ~/.gradle/caches. With the next build Gradle would attempt to download them again. What is your specific use case? Do you use dynamic dependency versions or SNAPSHOT versions? On Unix systems, you can delete … Read more

Using Gradle to build a jar with dependencies

I posted a solution in JIRA against Gradle: // Include dependent libraries in archive. mainClassName = “com.company.application.Main” jar { manifest { attributes “Main-Class”: “$mainClassName” } from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } } Note that mainClassName must appear BEFORE jar {.

Using Gradle to find dependency tree

Without modules: gradle dependencies For Android: gradle app:dependencies Using gradle wrapper: ./gradlew app:dependencies Note: Replace app with the project module name. Additionally, if you want to check if something is compile vs. testCompile vs androidTestCompile dependency as well as what is pulling it in: ./gradlew :app:dependencyInsight –configuration compile –dependency <name> ./gradlew :app:dependencyInsight –configuration testCompile –dependency … Read more

What’s the difference between implementation, api and compile in Gradle?

tl;dr Just replace: compile with implementation (if you don’t need transitivity) or api (if you need transitivity) testCompile with testImplementation debugCompile with debugImplementation androidTestCompile with androidTestImplementation compileOnly is still valid. It was added in 3.0 to replace provided and not compile. (provided introduced when Gradle didn’t have a configuration name for that use-case and named … Read more