{"record":{"id":"6c6b7eaf43108d0f","repo":"GoogleContainerTools/jib","slug":"skaffoldfailifjiboutofdate-requires-jib-requiredv","errorCode":null,"errorMessage":"_skaffoldFailIfJibOutOfDate requires jib.requiredVersion to be set","messagePattern":"_skaffoldFailIfJibOutOfDate requires jib\\.requiredVersion to be set","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/skaffold/CheckJibVersionTask.java","lineNumber":40,"sourceCode":"import org.gradle.api.GradleException;\nimport org.gradle.api.tasks.TaskAction;\n\n/**\n * This internal Skaffold-related goal checks that the Jib plugin version is within some specified\n * range. It is only required so that older versions of Jib (prior to the introduction of the {@code\n * jib.requiredVersion} property) will error in such a way that it indicates the jib version is out\n * of date. This goal can be removed once there are no users of Jib prior to 1.4.0.\n *\n * <p>Expected use: {@code ./gradlew _skaffoldFailIfJibOutOfDate -Djib.requiredVersion='[1.4,2)'\n * jibDockerBuild --image=xxx}\n */\npublic class CheckJibVersionTask extends DefaultTask {\n\n  /** Task Action, check if jib and skaffold versions are compatible. */\n  @TaskAction\n  public void checkVersion() {\n    if (Strings.isNullOrEmpty(System.getProperty(JibPlugin.REQUIRED_VERSION_PROPERTY_NAME))) {\n      throw new GradleException(\n          JibPlugin.SKAFFOLD_CHECK_REQUIRED_VERSION_TASK_NAME\n              + \" requires \"\n              + JibPlugin.REQUIRED_VERSION_PROPERTY_NAME\n              + \" to be set\");\n    }\n    // no-op as Jib version compatibility is actually checked in JibPlugin\n  }\n}\n","sourceCodeStart":22,"sourceCodeEnd":49,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/skaffold/CheckJibVersionTask.java#L22-L49","documentation":"CheckJibVersionTask is the Skaffold compatibility task (_skaffoldFailIfJibOutOfDate). Its @TaskAction checkVersion requires the jib.requiredVersion system property to be set; without it there is nothing to compare against, so it throws GradleException stating the property is required. With the property set, the task is a no-op since actual checking happens in JibPlugin.","triggerScenarios":"Executing the _skaffoldFailIfJibOutOfDate task directly or as part of a Skaffold-driven build without -Djib.requiredVersion=<version> on the JVM/system properties.","commonSituations":"Running the task manually from Gradle outside Skaffold; a Skaffold config that omits the version it normally injects; CI invoking gradle _skaffoldFailIfJibOutOfDate without the -D flag.","solutions":["Run with -Djib.requiredVersion=<expected-jib-version> matching your Skaffold expectation","Only run _skaffoldFailIfJibOutOfDate as part of a Skaffold build, which sets the property automatically","Exclude the task in CI scripts that don't intend Skaffold version checking","Upgrade Skaffold/jib plugin pair so the injected property is provided"],"exampleFix":"// before\n./gradlew _skaffoldFailIfJibOutOfDate\n// after\n./gradlew _skaffoldFailIfJibOutOfDate -Djib.requiredVersion=3.4.0","handlingStrategy":"validation","validationCode":"if (gradle.startParameter.taskNames.contains('_skaffoldFailIfJibOutOfDate') &&\n    !System.getProperty('jib.requiredVersion')) {\n  throw new GradleException('_skaffoldFailIfJibOutOfDate must run with -Djib.requiredVersion=<version>')\n}","typeGuard":null,"tryCatchPattern":"try {\n  checkJibVersionTask.execute()\n} catch (GradleException e) {\n  if (e.message.contains('requires jib.requiredVersion')) {\n    logger.error('Run this task only via Skaffold, or pass -Djib.requiredVersion=<version>')\n  } else { throw e }\n}","preventionTips":["Only invoke _skaffoldFailIfJibOutOfDate from Skaffold-managed builds","Document that the task needs -Djib.requiredVersion when run manually","Exclude the Skaffold check task in plain CI pipelines","Keep Skaffold's jib version config current so it injects the property"],"tags":["gradle","jib","skaffold","system-property"],"backgroundTag":"missing-required-flag","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}