GoogleContainerTools/skaffold · error

artifact %s has invalid Jib plugin type '%s'

Error message

artifact %s has invalid Jib plugin type '%s'

What it means

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.

Source

Thrown at pkg/skaffold/schema/validation/validation.go:610

				Location: cfg.YAMLInfos.Locate(pfrs[i]),
			})
		}
	}
	return errs
}

// validateJibPluginTypes makes sure that jib type is one of `maven`, or `gradle` if set.
func validateJibPluginTypes(cfg *parser.SkaffoldConfigEntry, artifacts []*latest.Artifact) (cfgErrs []ErrorWithLocation) {
	for i, a := range artifacts {
		if a.JibArtifact == nil || a.JibArtifact.Type == "" {
			continue
		}
		t := strings.ToLower(a.JibArtifact.Type)
		if t == "maven" || t == "gradle" {
			continue
		}
		cfgErrs = append(cfgErrs, ErrorWithLocation{
			Error:    fmt.Errorf("artifact %s has invalid Jib plugin type '%s'", a.ImageName, t),
			Location: cfg.YAMLInfos.LocateField(cfg.Build.Artifacts[i].JibArtifact, "Type"),
		})
	}
	return
}

// validateKoSync ensures that infer sync patterns contain the `kodata` string, since infer sync for the ko builder only supports static assets.
func validateKoSync(cfg *parser.SkaffoldConfigEntry, artifacts []*latest.Artifact) []ErrorWithLocation {
	var cfgErrs []ErrorWithLocation
	for i, a := range artifacts {
		if a.KoArtifact == nil || a.Sync == nil {
			continue
		}
		if len(a.Sync.Infer) > 0 && strings.Contains(a.KoArtifact.Main, "...") {
			cfgErrs = append(cfgErrs, ErrorWithLocation{
				Error:    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),
				Location: cfg.YAMLInfos.LocateField(cfg.Build.Artifacts[i].KoArtifact, "Main"),
			})

View on GitHub (pinned to a1189de023)

Solutions

  1. Set the jib artifact's `type` field to exactly `maven` or `gradle` (case-insensitive)
  2. Remove the `type` field entirely if it is not needed and let Skaffold infer the Jib plugin
  3. Run `skaffold config` / check skaffold.yaml schema docs for valid jib values

Example fix

# before
build:
  artifacts:
    - image: myapp
      jib:
        type: mvn
# after
build:
  artifacts:
    - image: myapp
      jib:
        type: maven
Defensive patterns

Strategy: validation

Validate before calling

const t = (artifact.jib?.type || '').toLowerCase();
if (t && t !== 'maven' && t !== 'gradle') {
  throw new Error(`jib artifact '${artifact.imageName}' has invalid type '${t}'; use 'maven' or 'gradle'`);
}

Type guard

function hasValidJibType(a) {
  const t = a?.jib?.type?.toLowerCase();
  return !t || t === 'maven' || t === 'gradle';
}

Try / catch

try {
  await skaffold.apply(config);
} catch (e) {
  if (/invalid Jib plugin type/.test(e.message)) {
    console.error('Fix the jib `type` field: must be maven or gradle');
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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'.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/c5723bfe168653e0. Report an issue: GitHub.