GoogleContainerTools/jib · error · MojoExecutionException

<container><appRoot> is not an absolute Unix-style path: <in

Error message

<container><appRoot> is not an absolute Unix-style path: <invalidPathValue>

What it means

During the build, Jib validates the <container><appRoot> parameter, which sets the directory in the container where the application files are placed. If the configured value is not an absolute Unix-style path (must start with '/'), the build surfaces InvalidAppRootException, which execute() wraps in a MojoExecutionException including the invalid value.

Source

Thrown at jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildImageMojo.java:120

            tempDirectoryProvider,
            getInjectedPluginExtensions());

    Future<Optional<String>> updateCheckFuture = Futures.immediateFuture(Optional.empty());
    try {
      GlobalConfig globalConfig = GlobalConfig.readConfig();
      updateCheckFuture = MojoCommon.newUpdateChecker(projectProperties, globalConfig, getLog());

      PluginConfigurationProcessor.createJibBuildRunnerForRegistryImage(
              new MavenRawConfiguration(this),
              new MavenSettingsServerCredentials(
                  getSession().getSettings(), getSettingsDecrypter()),
              projectProperties,
              globalConfig,
              new MavenHelpfulSuggestions(HELPFUL_SUGGESTIONS_PREFIX))
          .runBuild();

    } catch (InvalidAppRootException ex) {
      throw new MojoExecutionException(
          "<container><appRoot> is not an absolute Unix-style path: " + ex.getInvalidPathValue(),
          ex);

    } catch (InvalidContainerizingModeException ex) {
      throw new MojoExecutionException(
          "invalid value for <containerizingMode>: " + ex.getInvalidContainerizingMode(), ex);

    } catch (InvalidWorkingDirectoryException ex) {
      throw new MojoExecutionException(
          "<container><workingDirectory> is not an absolute Unix-style path: "
              + ex.getInvalidPathValue(),
          ex);
    } catch (InvalidPlatformException ex) {
      throw new MojoExecutionException(
          "<from><platforms> contains a platform configuration that is missing required values or has invalid values: "
              + ex.getMessage()
              + ": "
              + ex.getInvalidPlatform(),

View on GitHub (pinned to fb949e2676)

Solutions

  1. Change <appRoot> to an absolute Unix path starting with '/', e.g. /app.
  2. Remove <appRoot> to use the default (/app for non-exploded, standard layouts).
  3. If running on Windows, still use a forward-slash absolute path — it is a container path, not a host path.

Example fix

<!-- before -->
<container><appRoot>myapp/root</appRoot></container>
<!-- after -->
<container><appRoot>/myapp/root</appRoot></container>
Defensive patterns

Strategy: validation

Validate before calling

String appRoot = System.getProperty("jib.container.appRoot", pomAppRoot);
if (appRoot != null && !appRoot.startsWith("/")) {
  throw new IllegalArgumentException("<appRoot> must be an absolute Unix path, got: " + appRoot);
}

Try / catch

catch (MojoExecutionException e) { if (e.getMessage().contains("appRoot")) { /* correct <appRoot> to start with '/' and rerun */ } }

Prevention

When it happens

Trigger: Setting <appRoot> to a relative path like 'app' or 'myapp/root' instead of '/app'; using a Windows-style path like 'C:\app'; setting it to empty/invalid text in pom.xml or via -Djib.container.appRoot.

Common situations: Porting configs from Windows dev machines; forgetting the leading slash when customizing the app directory; copying Spring Boot layered-jar configs with wrong paths.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/30ab275e4c4ac3ae. Report an issue: GitHub.