Could not resolve all dependencies for configuration
ID: java/gradle-dependency-resolution
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8 | active | — | — | — |
Root Cause
Gradle dependency resolution failure occurs when Gradle cannot find a declared dependency in any configured repository, when version constraints conflict, or when network issues prevent downloading artifacts.
genericWorkarounds
-
88% success Verify the dependency coordinates (groupId, artifactId, version) are correct and the repository is configured
1. Search for the dependency on search.maven.org to verify the correct coordinates. 2. Check that the repository hosting the artifact is declared in build.gradle: repositories { mavenCentral() } or the appropriate custom repository URL. 3. For private/internal artifacts, ensure the repository URL, credentials, and authentication are configured correctly. 4. Run './gradlew dependencies --configuration runtimeClasspath' to see the full resolution result. -
82% success Use Gradle's dependency resolution strategy to handle version conflicts explicitly
1. Add a resolution strategy: configurations.all { resolutionStrategy { failOnVersionConflict() } } to surface conflicts. 2. Force specific versions: resolutionStrategy { force 'group:artifact:version' }. 3. Use a platform/BOM: implementation platform('org.springframework.boot:spring-boot-dependencies:3.2.0') for consistent versions. 4. Check network connectivity and proxy settings if artifacts cannot be downloaded. 5. Run with --refresh-dependencies to bypass the cache if a corrupted artifact is suspected.
Dead Ends
Common approaches that don't work:
-
Adding mavenLocal() as the first repository to work around resolution failures
60% fail
mavenLocal() uses the local Maven repository (~/.m2/repository), which may contain stale, corrupted, or snapshot artifacts. Builds that depend on mavenLocal() are not reproducible across machines. It can mask real resolution problems by serving outdated artifacts.
-
Disabling dependency verification or checksum validation to force resolution
75% fail
Dependency verification exists to prevent supply chain attacks and corrupted downloads. Disabling it may allow tampered or incomplete artifacts to be used, introducing security vulnerabilities or hard-to-diagnose runtime errors.