GoogleContainerTools/jib · error · MojoExecutionException

_skaffold-fail-if-jib-out-of-date requires jib.requiredVersi

Error message

_skaffold-fail-if-jib-out-of-date requires jib.requiredVersion to be set

What it means

The _skaffold-fail-if-jib-out-of-date goal (CheckJibVersionMojo) exists only to run the version check, which requires the jib.requiredVersion system property to be set. If the property is missing or empty, the mojo refuses to run and throws this MojoExecutionException. It signals that the goal was invoked outside the context that normally supplies the property (Skaffold).

Source

Thrown at jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/CheckJibVersionMojo.java:49

 * jib.requiredVersion} property) will error in such a way that it indicates the jib version is out
 * of date. This goal can be removed once there are no users of Jib prior to 1.4.0.
 *
 * <p>Expected use: {@code mvn jib:_skaffold-fail-if-jib-out-of-date -Djib.requiredVersion='[1.4,2)'
 * jib:build -Dimage=xxx}
 */
@Mojo(
    name = CheckJibVersionMojo.GOAL_NAME,
    requiresProject = false,
    requiresDependencyCollection = ResolutionScope.NONE,
    defaultPhase = LifecyclePhase.INITIALIZE)
public class CheckJibVersionMojo extends SkaffoldBindingMojo {

  @VisibleForTesting static final String GOAL_NAME = "_skaffold-fail-if-jib-out-of-date";

  @Override
  public void execute() throws MojoExecutionException, MojoFailureException {
    if (Strings.isNullOrEmpty(System.getProperty(MojoCommon.REQUIRED_VERSION_PROPERTY_NAME))) {
      throw new MojoExecutionException(
          GOAL_NAME + " requires " + MojoCommon.REQUIRED_VERSION_PROPERTY_NAME + " to be set");
    }
    checkJibVersion();
  }
}

View on GitHub (pinned to fb949e2676)

Solutions

  1. Provide the property, e.g. mvn jib:_skaffold-fail-if-jib-out-of-date -Djib.requiredVersion=3.4.0.
  2. Don't call this Skaffold-internal goal directly; let Skaffold run it as part of its build.
  3. If a profile/plugin binding invokes it, add <systemProperties><jib.requiredVersion>...</jib.requiredVersion></systemProperties> or pass it on the command line.
  4. Remove the goal binding if the check is not wanted.

Example fix

// before
mvn jib:_skaffold-fail-if-jib-out-of-date
// after
mvn jib:_skaffold-fail-if-jib-out-of-date -Djib.requiredVersion=3.4.0
Defensive patterns

Strategy: validation

Validate before calling

if (System.getProperty("jib.requiredVersion") == null) {
  throw new IllegalStateException("Pass -Djib.requiredVersion=<version> when invoking _skaffold-fail-if-jib-out-of-date");
}

Try / catch

try { ... } catch (MojoExecutionException e) { if (e.getMessage().contains("requires jib.requiredVersion")) { /* add the -Djib.requiredVersion flag */ } }

Prevention

When it happens

Trigger: Running 'mvn <something>:check-jib-version' or the _skaffold-fail-if-jib-out-of-date goal directly from the command line or a pom without -Djib.requiredVersion=... set.

Common situations: Developers invoking the Skaffold-internal goal manually in CI; a Maven profile triggering the goal without the property; a Skaffold misconfiguration that omits the system property it normally injects.

Understand the failure class

Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.

Related errors


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/e55027482e568604. Report an issue: GitHub.