GoogleContainerTools/jib · error · GradleException

Skaffold sync is currently only available for 'jar' style Ji

Error message

Skaffold sync is currently only available for 'jar' style Jib projects, but the project ${getProject().getName()} is configured to generate a 'war'

What it means

SyncMapTask (jib:skaffoldSyncMap equivalent) refuses to produce a Skaffold sync map for WAR projects. Skaffold file-sync support in Jib is implemented only for jar-style (bootJar/jar) builds; the task checks projectProperties.isWarProject() and fails fast with a GradleException.

Source

Thrown at jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/skaffold/SyncMapTask.java:64

  /** Task Action, lists files and container targets. */
  @TaskAction
  public void listFilesAndTargets() {
    Preconditions.checkNotNull(jibExtension);

    try (TempDirectoryProvider tempDirectoryProvider = new TempDirectoryProvider()) {
      GradleProjectProperties projectProperties =
          GradleProjectProperties.getForProject(
              getProject(),
              getLogger(),
              tempDirectoryProvider,
              jibExtension.getConfigurationName().get());

      GradleRawConfiguration configuration = new GradleRawConfiguration(jibExtension);

      // TODO: move these shared checks with SyncMapMojo into plugins-common
      if (projectProperties.isWarProject()) {
        throw new GradleException(
            "Skaffold sync is currently only available for 'jar' style Jib projects, but the project "
                + getProject().getName()
                + " is configured to generate a 'war'");
      }
      try {
        if (!ContainerizingMode.EXPLODED.equals(
            ContainerizingMode.from(jibExtension.getContainerizingMode()))) {
          throw new GradleException(
              "Skaffold sync is currently only available for Jib projects in 'exploded' containerizing mode, but the containerizing mode of "
                  + getProject().getName()
                  + " is '"
                  + jibExtension.getContainerizingMode()
                  + "'");
        }
      } catch (InvalidContainerizingModeException ex) {
        throw new GradleException("Invalid containerizing mode", ex);
      }

View on GitHub (pinned to fb949e2676)

Solutions

  1. Remove the war plugin / war packaging and build a jar instead.
  2. If you need both, keep the war configuration out of the project Skaffold syncs against.
  3. Fall back to regular Jib container builds (image rebuild on change) instead of Skaffold sync for WAR projects.
  4. Track the plugins-common TODO: shared war check with SyncMapMojo — Maven WAR projects are equally unsupported.

Example fix

// before
plugins { id 'war' }
// after
plugins { id 'java' } // or bootJar; keep packaging as jar for Skaffold sync
Defensive patterns

Strategy: validation

Validate before calling

// build.gradle
if (plugins.hasPlugin('war')) {
  throw new GradleException('Skaffold sync requires jar packaging; war plugin applied')
}

Prevention

When it happens

Trigger: Running the Skaffold sync map task on a Gradle project where the war plugin is applied (or the project is otherwise detected as a WAR project), while invoking Skaffold sync.

Common situations: A Spring Boot or web project with 'java { withWar...' or the war plugin applied; developers switching a project from jar to war packaging and then running Skaffold dev with Jib containerizing.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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