{"record":{"id":"de95981da8453306","repo":"GoogleContainerTools/jib","slug":"ex-getmessage-de9598","errorCode":null,"errorMessage":"${ex.getMessage()}","messagePattern":"\\$\\{ex\\.getMessage\\(\\)\\}","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/InitMojo.java","lineNumber":55,"sourceCode":"\n  @Override\n  public void execute() throws MojoExecutionException {\n    checkJibVersion();\n    MavenProject project = getProject();\n    // Ignore pom projects\n    if (\"pom\".equals(project.getPackaging())) {\n      return;\n    }\n\n    SkaffoldInitOutput skaffoldInitOutput = new SkaffoldInitOutput();\n    skaffoldInitOutput.setImage(getTargetImage());\n    skaffoldInitOutput.setProject(project.getGroupId() + \":\" + project.getArtifactId());\n    System.out.println();\n    System.out.println(\"BEGIN JIB JSON\");\n    try {\n      System.out.println(skaffoldInitOutput.getJsonString());\n    } catch (IOException ex) {\n      throw new MojoExecutionException(ex.getMessage(), ex);\n    }\n  }\n}\n","sourceCodeStart":37,"sourceCodeEnd":59,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/InitMojo.java#L37-L59","documentation":"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.","triggerScenarios":"Executing the jib:init goal and SkaffoldInitOutput.getJsonString() raises IOException during JSON serialization, or stdout is closed/broken.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { mvn jib:init ... } catch (exit non-zero) { /* run with -e, check stdout consumer didn't close early (broken pipe) */ }","preventionTips":["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"],"tags":["maven","skaffold","json","io"],"backgroundTag":"json-serialization-failed","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}