{"record":{"id":"4a22cb0e54b1858d","repo":"GoogleContainerTools/jib","slug":"message-from-invalidimagereferenceexception-via-h","errorCode":null,"errorMessage":"<message from InvalidImageReferenceException via HelpfulSuggestions.forInvalidImageReference>","messagePattern":"<message from InvalidImageReferenceException via HelpfulSuggestions\\.forInvalidImageReference>","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildImageMojo.java","lineNumber":171,"sourceCode":"          \"<container><creationTime> should be an ISO 8601 date-time (see \"\n              + \"DateTimeFormatter.ISO_DATE_TIME) or a special keyword (\\\"EPOCH\\\", \"\n              + \"\\\"USE_CURRENT_TIMESTAMP\\\"): \"\n              + ex.getInvalidCreationTime(),\n          ex);\n\n    } catch (JibPluginExtensionException ex) {\n      String extensionName = ex.getExtensionClass().getName();\n      throw new MojoExecutionException(\n          \"error running extension '\" + extensionName + \"': \" + ex.getMessage(), ex);\n\n    } catch (IncompatibleBaseImageJavaVersionException ex) {\n      throw new MojoExecutionException(\n          HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForMaven(\n              ex.getBaseImageMajorJavaVersion(), ex.getProjectMajorJavaVersion()),\n          ex);\n\n    } catch (InvalidImageReferenceException ex) {\n      throw new MojoExecutionException(\n          HelpfulSuggestions.forInvalidImageReference(ex.getInvalidReference()), ex);\n\n    } catch (IOException\n        | CacheDirectoryCreationException\n        | MainClassInferenceException\n        | InvalidGlobalConfigException ex) {\n      throw new MojoExecutionException(ex.getMessage(), ex);\n\n    } catch (BuildStepsExecutionException ex) {\n      throw new MojoExecutionException(ex.getMessage(), ex.getCause());\n\n    } catch (ExtraDirectoryNotFoundException ex) {\n      throw new MojoExecutionException(\n          \"<extraDirectories><paths> contain \\\"from\\\" directory that doesn't exist locally: \"\n              + ex.getPath(),\n          ex);\n    } finally {\n      tempDirectoryProvider.close();","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildImageMojo.java#L153-L189","documentation":"jib-maven-plugin throws this when the <from><image>, <to><image>, or related image reference string cannot be parsed as a valid registry/repository/tag reference. HelpfulSuggestions.forInvalidImageReference includes the invalid reference and suggests the expected format (e.g. registry/project/image:tag). It surfaces as a MojoExecutionException from BuildImageMojo.execute.","triggerScenarios":"Running 'mvn jib:build' with an image reference that violates Docker registry naming rules: empty, illegal characters, uppercase in repository, malformed tag/digest, or a bare name with spaces (InvalidImageReferenceException).","commonSituations":"Typo in the image name in pom.xml; using an environment placeholder that expands empty; adding a tag with invalid characters like ':' or '#'; forgetting the registry prefix when needed.","solutions":["Inspect the invalid reference printed in the message and fix its format in <from><image> or <to><image>.","Use the full form <registry>/<repository>:<tag>, e.g. 'gcr.io/my-project/my-app:1.0'.","If the value comes from a property or env substitution, verify it expands to a non-empty, well-formed string."],"exampleFix":"<!-- before -->\n<to><image>My App Image</image></to>\n<!-- after -->\n<to><image>gcr.io/my-project/my-app:1.0</image></to>","handlingStrategy":"validation","validationCode":"String ref = \"gcr.io/my-project/my-app:1.0\";\nif (!ref.matches(\"[a-z0-9]+((\\.|/|:|-|_)[a-z0-9]+)*(:[\\w.-]+)?(@sha256:[a-f0-9]{64})?\")) {\n  throw new IllegalArgumentException(\"invalid image reference: \" + ref);\n}","typeGuard":null,"tryCatchPattern":"try { ... } catch (MojoExecutionException e) { if (e.getCause() instanceof InvalidImageReferenceException) { /* correct the reference in pom */ } throw e; }","preventionTips":["Always use fully qualified lowercase <registry>/<repo>:<tag> references","Avoid spaces and uppercase in repository names","Verify property/env substitutions expand to non-empty values before building"],"tags":["maven","jib","image-reference","configuration"],"backgroundTag":"invalid-url-format","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}