{"record":{"id":"f86bec6965bf2f7f","repo":"GoogleContainerTools/jib","slug":"packaged-containerizing-mode-for-war-is-not-yet-su","errorCode":null,"errorMessage":"packaged containerizing mode for WAR is not yet supported","messagePattern":"packaged containerizing mode for WAR is not yet supported","errorType":"validation","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java","lineNumber":878,"sourceCode":"    if (appRoot.isEmpty()) {\n      appRoot =\n          projectProperties.isWarProject()\n              ? DEFAULT_JETTY_APP_ROOT\n              : JavaContainerBuilder.DEFAULT_APP_ROOT;\n    }\n    try {\n      return AbsoluteUnixPath.get(appRoot);\n    } catch (IllegalArgumentException ex) {\n      throw new InvalidAppRootException(appRoot, appRoot, ex);\n    }\n  }\n\n  static ContainerizingMode getContainerizingModeChecked(\n      RawConfiguration rawConfiguration, ProjectProperties projectProperties)\n      throws InvalidContainerizingModeException {\n    ContainerizingMode mode = ContainerizingMode.from(rawConfiguration.getContainerizingMode());\n    if (mode == ContainerizingMode.PACKAGED && projectProperties.isWarProject()) {\n      throw new UnsupportedOperationException(\n          \"packaged containerizing mode for WAR is not yet supported\");\n    }\n    return mode;\n  }\n\n  @VisibleForTesting\n  static Optional<AbsoluteUnixPath> getWorkingDirectoryChecked(RawConfiguration rawConfiguration)\n      throws InvalidWorkingDirectoryException {\n    Optional<String> directory = rawConfiguration.getWorkingDirectory();\n    if (!directory.isPresent()) {\n      return Optional.empty();\n    }\n\n    String path = directory.get();\n    try {\n      return Optional.of(AbsoluteUnixPath.get(path));\n    } catch (IllegalArgumentException ex) {\n      throw new InvalidWorkingDirectoryException(path, path, ex);","sourceCodeStart":860,"sourceCodeEnd":896,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java#L860-L896","documentation":"Jib's containerizingMode option can be 'exploded' or 'packaged'; 'packaged' places the built artifact as a single file. getContainerizingModeChecked rejects containerizingMode=packaged on WAR projects with UnsupportedOperationException because packaging a WAR as a single file in the container is not yet implemented.","triggerScenarios":"processCommonConfiguration -> getContainerizingModeChecked when ContainerizingMode.from(...) resolves to PACKAGED while projectProperties.isWarProject() is true (Maven <packaging>war</packaging> or Gradle war plugin).","commonSituations":"Users with a WAR project (or a project applying the war plugin alongside jar) set jib.containerizingMode='packaged' expecting a single WAR deployed like a jar; shared build scripts that set packaged mode for all modules in a multi-module build.","solutions":["Switch to containerizingMode='exploded' for WAR projects (the supported mode for WARs).","Only apply the packaged mode in non-WAR modules, e.g. guard the setting with 'if (!project.plugins.hasPlugin(WarPlugin))'.","Remove the containerizingMode line entirely to use the default mode appropriate for the project type."],"exampleFix":"// before (build.gradle of a WAR module)\njib.containerizingMode = 'packaged'\n// after\njib.containerizingMode = 'exploded'","handlingStrategy":"type-guard","validationCode":"// Gradle: guard packaged mode for WAR projects\nif (jib.containerizingMode.get() == 'packaged' && plugins.hasPlugin('war')) {\n  throw new IllegalArgumentException(\"containerizingMode=packaged is unsupported for WAR projects\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  jibContainerBuilder = processor.processCommonConfiguration(...);\n} catch (UnsupportedOperationException e) {\n  logger.error(\"Use containerizingMode=exploded for WAR projects: \" + e.getMessage());\n}","preventionTips":["Use 'exploded' mode for WAR projects","In multi-module builds, set containerizingMode conditionally per module type","Check Jib docs/release notes for when packaged WAR support lands"],"tags":["container-image","unsupported-feature","java","war"],"backgroundTag":"unsupported-operation","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"}