GoogleContainerTools/jib · error · MojoExecutionException
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 packaging of ${getProject().getArtifactId()} is '${getProject().getPackaging()}' What it means
SyncMapMojo (skaffold-sync goal) generates the sync map Skaffold uses for hot-reloading files into a running container. Sync only works for jar-packaged projects, so the mojo throws this MojoExecutionException when the project's <packaging> is anything other than 'jar' (e.g. war, pom, custom). This is a configuration incompatibility, not a bug.
Source
Thrown at jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/SyncMapMojo.java:56
name = SyncMapMojo.GOAL_NAME,
requiresDependencyCollection = ResolutionScope.COMPILE_PLUS_RUNTIME)
public class SyncMapMojo extends JibPluginConfiguration {
@VisibleForTesting static final String GOAL_NAME = "_skaffold-sync-map";
@Parameter SkaffoldConfiguration skaffold = new SkaffoldConfiguration();
@Override
public void execute() throws MojoExecutionException {
checkJibVersion();
if (MojoCommon.shouldSkipJibExecution(this)) {
return;
}
// TODO: move these shared checks with SyncMapTask into plugins-common
// add check that means this is only for jars
if (!"jar".equals(getProject().getPackaging())) {
throw new MojoExecutionException(
"Skaffold sync is currently only available for 'jar' style Jib projects, but the packaging of "
+ getProject().getArtifactId()
+ " is '"
+ getProject().getPackaging()
+ "'");
}
// add check for exploded containerization
try {
if (!ContainerizingMode.EXPLODED.equals(ContainerizingMode.from(getContainerizingMode()))) {
throw new MojoExecutionException(
"Skaffold sync is currently only available for Jib projects in 'exploded' containerizing mode, but the containerizing mode of "
+ getProject().getArtifactId()
+ " is '"
+ getContainerizingMode()
+ "'");
}
} catch (InvalidContainerizingModeException ex) {
throw new MojoExecutionException("Invalid containerizing mode", ex);View on GitHub (pinned to fb949e2676)
Solutions
- Change the module packaging to <packaging>jar</packaging> if a jar is actually intended.
- Disable Skaffold sync for that module (remove sync config or skip the goal) since only jar projects are supported.
- For WAR projects, use Jib's WAR support for building but rely on rebuilds instead of sync.
- Split jar-producing code out of the war/pom module if sync is essential.
Example fix
// before <packaging>war</packaging> // after <packaging>jar</packaging>
Defensive patterns
Strategy: validation
Validate before calling
boolean syncSupported = "jar".equals(project.getPackaging());
if (!syncSupported) throw new IllegalStateException("Skaffold sync requires <packaging>jar</packaging>"); Try / catch
try { ... } catch (MojoExecutionException e) { if (e.getMessage().contains("only available for 'jar' style")) { /* disable sync for this module */ } } Prevention
- Only enable Skaffold sync on jar-packaged modules
- Scope Skaffold dev sync configuration per-module in multi-module projects
- Skip jib goals on aggregator <packaging>pom</packaging> modules
When it happens
Trigger: Running the skaffold-sync goal (or Skaffold dev with sync enabled) on a Maven project whose <packaging> is not 'jar'.
Common situations: Enabling Skaffold file sync on a WAR-based webapp or a pom aggregator module; applying a generic Skaffold config across mixed-packaging multi-module projects.
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
- Skaffold sync is currently only available for Jib projects i
- Could not determine Jib plugin version
- Jib plugin version is %s but is required to be %s
- _skaffold-fail-if-jib-out-of-date requires jib.requiredVersi
- Failed to resolve dependencies
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/0ef41b8916f9a6e6.
Report an issue: GitHub.