# Maven Jib / spring-boot:build-image Failure - Fix Image Build in CI

> Fix Jib (jib-maven-plugin) and spring-boot:build-image failures in CI - registry auth (401/403), an unreachable base image, or a missing Docker daemon for the buildpack builder.

Source: https://latchkey.dev/learn/java-jvm/maven-jib-build-image-failed  
Updated: 2026-06-25

A container-image build with Jib or Spring Boot’s `build-image` failed. The usual causes are registry authentication (401/403) when pushing or pulling the base image, an unreachable base image, or - for `build-image` - no Docker daemon for the buildpacks builder. Pure network pulls can also blip transiently.

## Diagnose it: which JDK is the build actually using?

JVM builds resolve a toolchain from several sources, and the one on PATH is often not the one compiling your code. A version mismatch surfaces as an unsupported class file version rather than as a toolchain error.

```Terminal
java -version 2>&1
echo "JAVA_HOME=$JAVA_HOME"
./gradlew -q javaToolchains 2>/dev/null || mvn -v

# class file 65 = Java 21, 61 = Java 17, 55 = Java 11
javap -verbose <SomeClass>.class | grep "major version"
```

> Pin the JDK with `setup-java` and declare the toolchain in the build file. Relying on whichever JDK the runner image ships makes an image update a build break.

## FAQ

### What causes Maven jib / spring-boot:build-image failure?

There are 2 common causes: registry authentication missing or wrong and no docker daemon for build-image, or a base-image pull failure. Jib pushes (and may pull a private base) using credential helpers or <to>/<from> auth.

### How do I fix Maven jib / spring-boot:build-image failure?

There are 2 fixes depending on which cause you have: supply registry credentials in ci and for build-image, ensure a docker daemon (or use jib:build daemonless). Work through them in order, since the first is the most common.

### What does Maven jib / spring-boot:build-image failure actually mean?

The image build fails with Build to <registry>/...

### How do I stop Maven jib / spring-boot:build-image failure happening again?

Inject registry credentials from CI secrets for both from and to. The prevention section lists 3 changes that keep it from recurring.

### Can Latchkey fix this automatically?

Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
