{"record":{"id":"08a6dab82b3e7424","repo":"GoogleContainerTools/jib","slug":"format-parameter-is-configured-with-value-form","errorCode":null,"errorMessage":"<format> parameter is configured with value '<format>', but the only valid configuration options are 'Docker' and 'OCI'.","messagePattern":"<format> parameter is configured with value '<format>', but the only valid configuration options are 'Docker' and 'OCI'\\.","errorType":"validation","errorClass":"MojoFailureException","httpStatus":null,"severity":"error","filePath":"jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildImageMojo.java","lineNumber":72,"sourceCode":"    name = BuildImageMojo.GOAL_NAME,\n    requiresDependencyResolution = ResolutionScope.RUNTIME_PLUS_SYSTEM,\n    threadSafe = true)\npublic class BuildImageMojo extends JibPluginConfiguration {\n\n  @VisibleForTesting static final String GOAL_NAME = \"build\";\n\n  private static final String HELPFUL_SUGGESTIONS_PREFIX = \"Build image failed\";\n\n  @Override\n  public void execute() throws MojoExecutionException, MojoFailureException {\n    checkJibVersion();\n    if (MojoCommon.shouldSkipJibExecution(this)) {\n      return;\n    }\n\n    // Validates 'format'.\n    if (Arrays.stream(ImageFormat.values()).noneMatch(value -> value.name().equals(getFormat()))) {\n      throw new MojoFailureException(\n          \"<format> parameter is configured with value '\"\n              + getFormat()\n              + \"', but the only valid configuration options are '\"\n              + ImageFormat.Docker\n              + \"' and '\"\n              + ImageFormat.OCI\n              + \"'.\");\n    }\n\n    // Parses 'to' into image reference.\n    if (Strings.isNullOrEmpty(getTargetImage())) {\n      throw new MojoFailureException(\n          HelpfulSuggestions.forToNotConfigured(\n              \"Missing target image parameter\",\n              \"<to><image>\",\n              \"pom.xml\",\n              \"mvn compile jib:build -Dimage=<your image name>\"));\n    }","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildImageMojo.java#L54-L90","documentation":"BuildImageMojo.execute() validates the <format> configuration parameter against the ImageFormat enum names ('Docker' and 'OCI') and throws a MojoFailureException when the configured value matches neither. This is a fail-fast configuration check so users get a clear message instead of a downstream failure during image building.","triggerScenarios":"Running 'mvn jib:build' (or jib:dockerBuild/jib:buildTar which share this mojo path) with <format> set to a value that is not exactly 'Docker' or 'OCI' — e.g. 'docker', 'oci', 'DockerFormat', or a typo.","commonSituations":"Typo in pom.xml <format>; assuming the value is case-insensitive ('docker' fails); copying a config from another tool that uses lowercase format names; YAML/properties injection producing unexpected values.","solutions":["Set <format> to exactly 'Docker' or 'OCI' (case-sensitive) in pom.xml or pass -Dformat=OCI.","If you meant to build to the Docker daemon, use jib:dockerBuild instead of setting <format>.","Remove the <format> element entirely to use the default format."],"exampleFix":"<!-- before -->\n<format>docker</format>\n<!-- after -->\n<format>Docker</format>","handlingStrategy":"validation","validationCode":"String format = System.getProperty(\"format\", pomFormat);\nif (format != null && !format.equals(\"Docker\") && !format.equals(\"OCI\")) {\n  throw new IllegalArgumentException(\"<format> must be 'Docker' or 'OCI', got: \" + format);\n}","typeGuard":null,"tryCatchPattern":"catch (MojoFailureException e) { System.err.println(e.getMessage()); /* fix <format> in pom or -Dformat */ }","preventionTips":["Use only 'Docker' or 'OCI' verbatim — the comparison is case-sensitive","Prefer jib:dockerBuild for Docker-daemon builds instead of setting <format>","Validate CI config with mvn help:effective-pom before builds"],"tags":["maven","jib","configuration","enum-value"],"backgroundTag":"invalid-enum-value","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"}