{"record":{"id":"9b9e10640d5a429d","repo":"GoogleContainerTools/jib","slug":"incomplete-extradirectories-paths-configuration","errorCode":null,"errorMessage":"Incomplete <extraDirectories><paths> configuration; source directory must be set","messagePattern":"Incomplete <extraDirectories><paths> configuration; source directory must be set","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MojoCommon.java","lineNumber":115,"sourceCode":"              projectProperties.log(LogEvent.lifecycle(privacyMessage));\n              projectProperties.log(LogEvent.lifecycle(\"\"));\n            });\n  }\n\n  /**\n   * Gets the list of extra directory paths from a {@link JibPluginConfiguration}. Returns {@code\n   * (project dir)/src/main/jib} by default if not configured.\n   *\n   * @param jibPluginConfiguration the build configuration\n   * @return the list of resolved extra directories\n   */\n  static List<ExtraDirectoryParameters> getExtraDirectories(\n      JibPluginConfiguration jibPluginConfiguration) {\n    List<ExtraDirectoryParameters> extraDirectories = jibPluginConfiguration.getExtraDirectories();\n    if (!extraDirectories.isEmpty()) {\n      for (ExtraDirectoryParameters directory : extraDirectories) {\n        if (directory.getFrom().equals(Paths.get(\"\"))) {\n          throw new IllegalArgumentException(\n              \"Incomplete <extraDirectories><paths> configuration; source directory must be set\");\n        }\n      }\n      return extraDirectories;\n    }\n\n    MavenProject project = Preconditions.checkNotNull(jibPluginConfiguration.getProject());\n    return Collections.singletonList(\n        new ExtraDirectoryParameters(\n            project.getBasedir().toPath().resolve(\"src\").resolve(\"main\").resolve(\"jib\").toFile(),\n            \"/\"));\n  }\n\n  /**\n   * Converts a list of {@link PermissionConfiguration} to an equivalent {@code\n   * String->FilePermission} map.\n   *\n   * @param permissionList the list to convert","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MojoCommon.java#L97-L133","documentation":"An entry in the <extraDirectories><paths> configuration has an empty 'from' (source) directory. MojoCommon.getExtraDirectories validates each ExtraDirectoryParameters and throws IllegalArgumentException when directory.getFrom() equals Paths.get(\"\") because Jib cannot copy from an unspecified source path.","triggerScenarios":"Declaring <extraDirectories><paths><path><into>/app</into></path></paths></extraDirectories> with a <into> but no <from>; or an empty <path> element; programmatic construction of ExtraDirectoryParameters with an empty from path.","commonSituations":"Users migrating from the old <extraDirectory> singular config writing the new plural form but forgetting <from>; copy-pasting path elements and deleting the from line; templated pom generation that leaves from blank when a property is unset.","solutions":["Set the <from> source directory on every <path> entry: e.g. <path><from>src/main/jib</from><into>/app</into></path>.","Use the shorthand form <paths><path>src/main/jib</path></paths> if you don't need a custom <into>.","Ensure any Maven property feeding <from> (e.g. ${extra.dir}) is defined and non-empty in the active profile.","Remove entirely empty <path> elements left over from refactoring."],"exampleFix":"<!-- before -->\n<extraDirectories>\n  <paths>\n    <path><into>/app/resources</into></path>\n  </paths>\n</extraDirectories>\n\n<!-- after -->\n<extraDirectories>\n  <paths>\n    <path>\n      <from>src/main/jib</from>\n      <into>/app/resources</into>\n    </path>\n  </paths>\n</extraDirectories>","handlingStrategy":"validation","validationCode":"// Pre-validate extraDirectories config in a profile check or parent script:\n// every <path> must have a non-empty <from>\n// e.g. grep -A2 '<path>' pom.xml | grep -q '<from>' || echo 'missing <from> in extraDirectories path'","typeGuard":null,"tryCatchPattern":"try {\n  // jib build\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"source directory must be set\")) {\n    // add <from> to each <extraDirectories><paths><path> entry\n  }\n  throw e;\n}","preventionTips":["Always include <from> when using the expanded <path> form; use the shorthand form to avoid forgetting it.","Never rely on an unset Maven property to supply <from> — define defaults in propertyDefinitions.","Review extraDirectories config when migrating from the deprecated singular <extraDirectory> option."],"tags":["jib","maven","pom-configuration","extra-directories"],"backgroundTag":"missing-required-config-field","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"}