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

jib-maven-plugin (BuildTarMojo) throws this when the <container><appRoot> value is not an absolute Unix-style path (must start with '/' and be a valid Unix path). InvalidAppRootException provides the offending value, which is embedded in the message.

Source

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

            tempDirectoryProvider,
            getInjectedPluginExtensions());

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

      PluginConfigurationProcessor.createJibBuildRunnerForTarImage(
              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. Prefix the value with '/' e.g. <appRoot>/app</appRoot>.
  2. Use forward slashes only; remove any drive letter or backslashes.
  3. If using the default, remove the <appRoot> element entirely (default is /app).

Example fix

<!-- before -->
<container><appRoot>app/libs</appRoot></container>
<!-- after -->
<container><appRoot>/app/libs</appRoot></container>
Defensive patterns

Strategy: validation

Validate before calling

String appRoot = "app/libs";
if (!appRoot.startsWith("/") || appRoot.contains("\\")) {
  throw new IllegalArgumentException("<appRoot> must be an absolute Unix path: " + appRoot);
}

Try / catch

try { ... } catch (MojoExecutionException e) { if (e.getMessage().startsWith("<container><appRoot>")) { /* make path absolute */ } throw e; }

Prevention

When it happens

Trigger: Running 'mvn jib:buildTar' with <container><appRoot> set to a relative path like 'app/libs' or a Windows-style path like 'C:\app'.

Common situations: Setting appRoot to a relative directory out of habit; migrating configs from Windows machines with backslash paths; missing leading slash after hand-editing the pom.

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/c50653d202dbfb16. Report an issue: GitHub.