GoogleContainerTools/jib · error · MojoExecutionException

<container><appRoot> is not an absolute Unix-style path: ${e

Error message

<container><appRoot> is not an absolute Unix-style path: ${ex.getInvalidPathValue()}

What it means

During the Docker build, Jib validates <container><appRoot>: it must be an absolute Unix-style path (e.g. /app). InvalidAppRootException carries the offending value, which BuildDockerMojo rethrows as MojoExecutionException with this message and the cause attached.

Source

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

            tempDirectoryProvider,
            getInjectedPluginExtensions());

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

      PluginConfigurationProcessor.createJibBuildRunnerForDockerDaemonImage(
              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-style path starting with '/', e.g. /app.
  2. Remove <appRoot> entirely to use the default for your packaging type.
  3. Ensure property expansion like ${app.root} is not resolving to an empty string.
  4. On Windows builds, still use forward slashes and a leading slash for appRoot.

Example fix

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

Strategy: validation

Validate before calling

<appRoot>${jib.appRoot}</appRoot>
<!-- pre-check in CI -->
<!-- appRoot must match ^/.+ -->

Prevention

When it happens

Trigger: Setting <appRoot> in the jib-maven-plugin <container> configuration to a relative path (e.g. 'app'), a Windows-style path ('C:\app'), or an empty/invalid value, then running jib:dockerBuild.

Common situations: Developers on Windows writing backslash or drive-letter paths; typos omitting the leading slash; values templated from empty properties.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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