{"record":{"id":"c5723bfe168653e0","repo":"GoogleContainerTools/skaffold","slug":"artifact-s-has-invalid-jib-plugin-type-s","errorCode":null,"errorMessage":"artifact %s has invalid Jib plugin type '%s'","messagePattern":"artifact (.+?) has invalid Jib plugin type '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/validation/validation.go","lineNumber":610,"sourceCode":"\t\t\t\tLocation: cfg.YAMLInfos.Locate(pfrs[i]),\n\t\t\t})\n\t\t}\n\t}\n\treturn errs\n}\n\n// validateJibPluginTypes makes sure that jib type is one of `maven`, or `gradle` if set.\nfunc validateJibPluginTypes(cfg *parser.SkaffoldConfigEntry, artifacts []*latest.Artifact) (cfgErrs []ErrorWithLocation) {\n\tfor i, a := range artifacts {\n\t\tif a.JibArtifact == nil || a.JibArtifact.Type == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tt := strings.ToLower(a.JibArtifact.Type)\n\t\tif t == \"maven\" || t == \"gradle\" {\n\t\t\tcontinue\n\t\t}\n\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{\n\t\t\tError:    fmt.Errorf(\"artifact %s has invalid Jib plugin type '%s'\", a.ImageName, t),\n\t\t\tLocation: cfg.YAMLInfos.LocateField(cfg.Build.Artifacts[i].JibArtifact, \"Type\"),\n\t\t})\n\t}\n\treturn\n}\n\n// validateKoSync ensures that infer sync patterns contain the `kodata` string, since infer sync for the ko builder only supports static assets.\nfunc validateKoSync(cfg *parser.SkaffoldConfigEntry, artifacts []*latest.Artifact) []ErrorWithLocation {\n\tvar cfgErrs []ErrorWithLocation\n\tfor i, a := range artifacts {\n\t\tif a.KoArtifact == nil || a.Sync == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif len(a.Sync.Infer) > 0 && strings.Contains(a.KoArtifact.Main, \"...\") {\n\t\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{\n\t\t\t\tError:    fmt.Errorf(\"artifact %s cannot use inferred file sync when the ko.main field contains the '...' wildcard. Instead, specify the path to the main package without using wildcards\", a.ImageName),\n\t\t\t\tLocation: cfg.YAMLInfos.LocateField(cfg.Build.Artifacts[i].KoArtifact, \"Main\"),\n\t\t\t})","sourceCodeStart":592,"sourceCodeEnd":628,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/validation/validation.go#L592-L628","documentation":"Skaffold validates the `type` of each Jib artifact in the build section. A Jib artifact's type must be either 'maven' or 'gradle' (case-insensitive); anything else means Skaffold cannot tell which Jib plugin invocation to run, so configuration parsing fails with this error pointing at the offending `type` field in the YAML.","triggerScenarios":"A skaffold.yaml artifact with jib: and a `type:` field whose lowercased value is not 'maven' or 'gradle' (e.g. 'mvn', 'maven2', 'java', or a typo), processed via ProcessToErrorWithLocation -> validateJibPluginTypes.","commonSituations":"Typos like `type: mavin`, copying a config that used a different builder's type string, or setting type to a plugin name like 'jib-maven-plugin' instead of the required 'maven'/'gradle'.","solutions":["Set the jib artifact's `type` field to exactly `maven` or `gradle` (case-insensitive)","Remove the `type` field entirely if it is not needed and let Skaffold infer the Jib plugin","Run `skaffold config` / check skaffold.yaml schema docs for valid jib values"],"exampleFix":"# before\nbuild:\n  artifacts:\n    - image: myapp\n      jib:\n        type: mvn\n# after\nbuild:\n  artifacts:\n    - image: myapp\n      jib:\n        type: maven","handlingStrategy":"validation","validationCode":"const t = (artifact.jib?.type || '').toLowerCase();\nif (t && t !== 'maven' && t !== 'gradle') {\n  throw new Error(`jib artifact '${artifact.imageName}' has invalid type '${t}'; use 'maven' or 'gradle'`);\n}","typeGuard":"function hasValidJibType(a) {\n  const t = a?.jib?.type?.toLowerCase();\n  return !t || t === 'maven' || t === 'gradle';\n}","tryCatchPattern":"try {\n  await skaffold.apply(config);\n} catch (e) {\n  if (/invalid Jib plugin type/.test(e.message)) {\n    console.error('Fix the jib `type` field: must be maven or gradle');\n  } else throw e;\n}","preventionTips":["Only use 'maven' or 'gradle' as jib.type values","Validate skaffold.yaml against the published JSON schema in CI before running skaffold","Run `skaffold diagnose` locally to catch config errors early"],"tags":["skaffold","config-validation","jib","yaml"],"backgroundTag":"skaffold-config-validation","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}