{"record":{"id":"00286660f2e15e4c","repo":"GoogleContainerTools/jib","slug":"container-workingdirectory-is-not-an-absolute-u-002866","errorCode":null,"errorMessage":"<container><workingDirectory> is not an absolute Unix-style path: <invalidPathValue>","messagePattern":"<container><workingDirectory> is not an absolute Unix-style path: <invalidPathValue>","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildTarMojo.java","lineNumber":107,"sourceCode":"              new MavenRawConfiguration(this),\n              new MavenSettingsServerCredentials(\n                  getSession().getSettings(), getSettingsDecrypter()),\n              projectProperties,\n              globalConfig,\n              new MavenHelpfulSuggestions(HELPFUL_SUGGESTIONS_PREFIX))\n          .runBuild();\n\n    } catch (InvalidAppRootException ex) {\n      throw new MojoExecutionException(\n          \"<container><appRoot> is not an absolute Unix-style path: \" + ex.getInvalidPathValue(),\n          ex);\n\n    } catch (InvalidContainerizingModeException ex) {\n      throw new MojoExecutionException(\n          \"invalid value for <containerizingMode>: \" + ex.getInvalidContainerizingMode(), ex);\n\n    } catch (InvalidWorkingDirectoryException ex) {\n      throw new MojoExecutionException(\n          \"<container><workingDirectory> is not an absolute Unix-style path: \"\n              + ex.getInvalidPathValue(),\n          ex);\n    } catch (InvalidPlatformException ex) {\n      throw new MojoExecutionException(\n          \"<from><platforms> contains a platform configuration that is missing required values or has invalid values: \"\n              + ex.getMessage()\n              + \": \"\n              + ex.getInvalidPlatform(),\n          ex);\n    } catch (InvalidContainerVolumeException ex) {\n      throw new MojoExecutionException(\n          \"<container><volumes> is not an absolute Unix-style path: \" + ex.getInvalidVolume(), ex);\n\n    } catch (InvalidFilesModificationTimeException ex) {\n      throw new MojoExecutionException(\n          \"<container><filesModificationTime> should be an ISO 8601 date-time (see \"\n              + \"DateTimeFormatter.ISO_DATE_TIME) or special keyword \\\"EPOCH_PLUS_SECOND\\\": \"","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildTarMojo.java#L89-L125","documentation":"BuildTarMojo.execute throws this when <container><workingDirectory> is not an absolute Unix-style path. InvalidWorkingDirectoryException supplies the invalid value, embedded in the message. The working directory must start with '/' and use Unix path syntax.","triggerScenarios":"Running 'mvn jib:buildTar' with <container><workingDirectory> set to 'home/user/app' (no leading slash) or 'C:\\app'.","commonSituations":"Copying Dockerfile WORKDIR conventions incorrectly; Windows backslash paths pasted into the pom; forgetting the leading slash.","solutions":["Make the path absolute with a leading slash, e.g. /workspace.","Replace backslashes with forward slashes and remove drive letters.","Remove <workingDirectory> if the image default is acceptable."],"exampleFix":"<!-- before -->\n<container><workingDirectory>workspace/app</workingDirectory></container>\n<!-- after -->\n<container><workingDirectory>/workspace/app</workingDirectory></container>","handlingStrategy":"validation","validationCode":"String workDir = \"workspace/app\";\nif (!workDir.startsWith(\"/\") || workDir.contains(\"\\\\\")) {\n  throw new IllegalArgumentException(\"<workingDirectory> must be absolute Unix path: \" + workDir);\n}","typeGuard":null,"tryCatchPattern":"try { ... } catch (MojoExecutionException e) { if (e.getMessage().startsWith(\"<container><workingDirectory>\")) { /* add leading slash */ } throw e; }","preventionTips":["Always prefix workingDirectory with '/'","Never paste Windows paths (C:\\...) into jib config","Remove the element if the image default working directory is fine"],"tags":["maven","jib","working-directory","path-validation"],"backgroundTag":"invalid-config-value","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"}