GoogleContainerTools/jib · error · MojoExecutionException
<extraDirectories><paths> contain "from" directory that does
Error message
<extraDirectories><paths> contain "from" directory that doesn't exist locally: <path>
What it means
Thrown as a MojoExecutionException from BuildTarMojo.execute when a directory configured under <extraDirectories><paths> with a 'from' attribute does not exist on the local filesystem (ExtraDirectoryNotFoundException). Jib includes the missing path in the message.
Source
Thrown at jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildTarMojo.java:162
HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForMaven(
ex.getBaseImageMajorJavaVersion(), ex.getProjectMajorJavaVersion()),
ex);
} catch (InvalidImageReferenceException ex) {
throw new MojoExecutionException(
HelpfulSuggestions.forInvalidImageReference(ex.getInvalidReference()), ex);
} catch (IOException
| CacheDirectoryCreationException
| MainClassInferenceException
| InvalidGlobalConfigException ex) {
throw new MojoExecutionException(ex.getMessage(), ex);
} catch (BuildStepsExecutionException ex) {
throw new MojoExecutionException(ex.getMessage(), ex.getCause());
} catch (ExtraDirectoryNotFoundException ex) {
throw new MojoExecutionException(
"<extraDirectories><paths> contain \"from\" directory that doesn't exist locally: "
+ ex.getPath(),
ex);
} finally {
tempDirectoryProvider.close();
MojoCommon.finishUpdateChecker(projectProperties, updateCheckFuture);
projectProperties.waitForLoggingThread();
getLog().info("");
}
}
}
View on GitHub (pinned to fb949e2676)
Solutions
- Create the directory referenced by the 'from' value, or fix the path in <extraDirectories><paths> to point at the existing directory.
- If the directory is generated, ensure the generating Maven execution (e.g. a plugin's generate-resources phase) runs before jib.
- Check for typos and correct relative-vs-absolute path resolution (relative paths resolve against the module directory).
- If no extra directories are needed, remove the <extraDirectories> configuration entirely.
Example fix
// before <extraDirectories><paths><path><from>src/main/jibx</from></path></paths></extraDirectories> // after <extraDirectories><paths><path><from>src/main/jib</from></path></paths></extraDirectories>
Defensive patterns
Strategy: validation
Validate before calling
// In a Maven Enforcer/rule or script, before the jib goal:
String from = "src/main/jib"; // value configured under <extraDirectories><paths>
java.io.File dir = new java.io.File(project.getBasedir(), from);
if (!dir.isDirectory()) throw new IllegalStateException("extra directory missing: " + dir); Prevention
- Bind the jib goal to a phase after any step that generates the extra directories.
- Keep extras directories inside the module and referenced with correct relative paths.
- Remove <extraDirectories> config entirely if unused.
- Add the extras directory to version control or ensure CI checkout includes it.
When it happens
Trigger: Configuring <extraDirectories><paths><path><from>src/main/jib-extra</from></path></paths> where that directory is absent at build time; also when the path is generated by another Maven phase that didn't run, or when a relative path resolves against an unexpected working directory.
Common situations: Renaming or deleting an extras directory without updating the POM; CI checkouts that exclude the directory; build-order issues where a resource-generation step hasn't produced the directory yet.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- extraDirectories.paths contain "from" directory that doesn't
- <container><appRoot> is not an absolute Unix-style path: ${e
- invalid value for <containerizingMode>: ${ex.getInvalidConta
- <container><appRoot> is not an absolute Unix-style path: <in
- invalid value for <containerizingMode>: <invalidContainerizi
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/8448f73eeeabef70.
Report an issue: GitHub.