{"record":{"id":"e55027482e568604","repo":"GoogleContainerTools/jib","slug":"skaffold-fail-if-jib-out-of-date-requires-jib-req","errorCode":null,"errorMessage":"_skaffold-fail-if-jib-out-of-date requires jib.requiredVersion to be set","messagePattern":"_skaffold-fail-if-jib-out-of-date requires jib\\.requiredVersion to be set","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/CheckJibVersionMojo.java","lineNumber":49,"sourceCode":" * 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 mvn jib:_skaffold-fail-if-jib-out-of-date -Djib.requiredVersion='[1.4,2)'\n * jib:build -Dimage=xxx}\n */\n@Mojo(\n    name = CheckJibVersionMojo.GOAL_NAME,\n    requiresProject = false,\n    requiresDependencyCollection = ResolutionScope.NONE,\n    defaultPhase = LifecyclePhase.INITIALIZE)\npublic class CheckJibVersionMojo extends SkaffoldBindingMojo {\n\n  @VisibleForTesting static final String GOAL_NAME = \"_skaffold-fail-if-jib-out-of-date\";\n\n  @Override\n  public void execute() throws MojoExecutionException, MojoFailureException {\n    if (Strings.isNullOrEmpty(System.getProperty(MojoCommon.REQUIRED_VERSION_PROPERTY_NAME))) {\n      throw new MojoExecutionException(\n          GOAL_NAME + \" requires \" + MojoCommon.REQUIRED_VERSION_PROPERTY_NAME + \" to be set\");\n    }\n    checkJibVersion();\n  }\n}\n","sourceCodeStart":31,"sourceCodeEnd":55,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/CheckJibVersionMojo.java#L31-L55","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Provide the property, e.g. mvn jib:_skaffold-fail-if-jib-out-of-date -Djib.requiredVersion=3.4.0.","Don't call this Skaffold-internal goal directly; let Skaffold run it as part of its build.","If a profile/plugin binding invokes it, add <systemProperties><jib.requiredVersion>...</jib.requiredVersion></systemProperties> or pass it on the command line.","Remove the goal binding if the check is not wanted."],"exampleFix":"// before\nmvn jib:_skaffold-fail-if-jib-out-of-date\n// after\nmvn jib:_skaffold-fail-if-jib-out-of-date -Djib.requiredVersion=3.4.0","handlingStrategy":"validation","validationCode":"if (System.getProperty(\"jib.requiredVersion\") == null) {\n  throw new IllegalStateException(\"Pass -Djib.requiredVersion=<version> when invoking _skaffold-fail-if-jib-out-of-date\");\n}","typeGuard":null,"tryCatchPattern":"try { ... } catch (MojoExecutionException e) { if (e.getMessage().contains(\"requires jib.requiredVersion\")) { /* add the -Djib.requiredVersion flag */ } }","preventionTips":["Don't invoke Skaffold-internal goals (_skaffold-*) directly; let Skaffold drive them","Always pass -Djib.requiredVersion when scripting this goal in CI","Document required system properties next to any custom Maven profile that binds the goal"],"tags":["maven","skaffold","system-property","cli"],"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"}