Build tools & artifact repositories · Lesson 8 of 9 · 3 min read
Troubleshooting builds
| Symptom | Likely cause | Fix |
|---|---|---|
Could not resolve dependency / 401 from Nexus |
Wrong credentials or server id mismatch, expired token (CodeArtifact 12h) | Check settings.xml server id = repository id; refresh token |
| Works locally, fails in CI | Local ~/.m2 has an artifact CI can't get (installed locally), different JDK, SNAPSHOT drift |
Build with an empty repo (-Dmaven.repo.local=/tmp/r), pin JDK via toolchain/wrapper |
NoSuchMethodError / ClassNotFoundException at runtime |
Dependency version conflict | dependency:tree/dependencyInsight, pin via BOM/constraints, enforcer |
| Build suddenly broke with no code change | Version range or SNAPSHOT changed upstream; Maven Central outage | Pin versions, lockfiles, proxy through a repository manager |
| Very slow builds | No caching, daemon cold, tests serial, downloading every run | Cache dependencies, Gradle build cache, parallel modules/tests |
401 on mvn deploy but resolve works |
Read-only user, or deploying a release version that already exists (400/403) | Use the CI publish identity; bump the version — releases are immutable |
| Out of memory in Gradle/Maven | Default heap too small for big builds or container limits | org.gradle.jvmargs, MAVEN_OPTS, bigger runner |
Enlarge diagram
Swipe sideways to see all of it, or tap to open it full screen.