GoogleContainerTools/jib · error · MojoExecutionException
${ex.getMessage()}
Error message
${ex.getMessage()} What it means
InitMojo (the jib:init goal used by Skaffold init) prints a JSON summary of the detected Jib project to stdout. If writing that JSON throws an IOException, it is wrapped in this MojoExecutionException carrying the original message. Like the files mojo, this should never happen normally and points at serialization or stream failure.
Source
Thrown at jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/InitMojo.java:55
@Override
public void execute() throws MojoExecutionException {
checkJibVersion();
MavenProject project = getProject();
// Ignore pom projects
if ("pom".equals(project.getPackaging())) {
return;
}
SkaffoldInitOutput skaffoldInitOutput = new SkaffoldInitOutput();
skaffoldInitOutput.setImage(getTargetImage());
skaffoldInitOutput.setProject(project.getGroupId() + ":" + project.getArtifactId());
System.out.println();
System.out.println("BEGIN JIB JSON");
try {
System.out.println(skaffoldInitOutput.getJsonString());
} catch (IOException ex) {
throw new MojoExecutionException(ex.getMessage(), ex);
}
}
}
View on GitHub (pinned to fb949e2676)
Solutions
- Ensure the process consuming Maven's stdout (e.g. skaffold init) does not exit before the JSON is printed.
- Run with mvn -e to see the wrapped cause and upgrade jib-maven-plugin to the latest version.
- Retry the goal without output redirection to rule out broken-pipe I/O.
- File an upstream issue if reproducible with the latest plugin version.
Defensive patterns
Strategy: try-catch
Try / catch
try { mvn jib:init ... } catch (exit non-zero) { /* run with -e, check stdout consumer didn't close early (broken pipe) */ } Prevention
- Don't let consumers of Maven stdout exit before JSON output completes
- Use the latest jib-maven-plugin release
- Diagnose with mvn -e and the wrapped IOException cause
When it happens
Trigger: Executing the jib:init goal and SkaffoldInitOutput.getJsonString() raises IOException during JSON serialization, or stdout is closed/broken.
Common situations: Piping Maven output into a consumer that exits early (broken pipe); plugin bug in JSON generation; running the init goal with an exotic project layout.
Understand the failure class
Background: "JSON serialization failed", "not JSON serializable", "Failed to serialize": why JSON marshaling errors happen and how to fix them — this error's family across 46 libraries.
Related errors
- ${ex.getMessage()}
- <exception message (IOException | CacheDirectoryCreationExce
- <exception message (IOException | CacheDirectoryCreationExce
- Could not determine Jib plugin version
- Jib plugin version is %s but is required to be %s
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/de95981da8453306.
Report an issue: GitHub.