{"record":{"id":"0ef41b8916f9a6e6","repo":"GoogleContainerTools/jib","slug":"skaffold-sync-is-currently-only-available-for-jar-0ef41b","errorCode":null,"errorMessage":"Skaffold sync is currently only available for 'jar' style Jib projects, but the packaging of ${getProject().getArtifactId()} is '${getProject().getPackaging()}'","messagePattern":"Skaffold sync is currently only available for 'jar' style Jib projects, but the packaging of (.+?) is '(.+?)'","errorType":"validation","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/SyncMapMojo.java","lineNumber":56,"sourceCode":"    name = SyncMapMojo.GOAL_NAME,\n    requiresDependencyCollection = ResolutionScope.COMPILE_PLUS_RUNTIME)\npublic class SyncMapMojo extends JibPluginConfiguration {\n\n  @VisibleForTesting static final String GOAL_NAME = \"_skaffold-sync-map\";\n\n  @Parameter SkaffoldConfiguration skaffold = new SkaffoldConfiguration();\n\n  @Override\n  public void execute() throws MojoExecutionException {\n    checkJibVersion();\n    if (MojoCommon.shouldSkipJibExecution(this)) {\n      return;\n    }\n\n    // TODO: move these shared checks with SyncMapTask into plugins-common\n    // add check that means this is only for jars\n    if (!\"jar\".equals(getProject().getPackaging())) {\n      throw new MojoExecutionException(\n          \"Skaffold sync is currently only available for 'jar' style Jib projects, but the packaging of \"\n              + getProject().getArtifactId()\n              + \" is '\"\n              + getProject().getPackaging()\n              + \"'\");\n    }\n    // add check for exploded containerization\n    try {\n      if (!ContainerizingMode.EXPLODED.equals(ContainerizingMode.from(getContainerizingMode()))) {\n        throw new MojoExecutionException(\n            \"Skaffold sync is currently only available for Jib projects in 'exploded' containerizing mode, but the containerizing mode of \"\n                + getProject().getArtifactId()\n                + \" is '\"\n                + getContainerizingMode()\n                + \"'\");\n      }\n    } catch (InvalidContainerizingModeException ex) {\n      throw new MojoExecutionException(\"Invalid containerizing mode\", ex);","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/SyncMapMojo.java#L38-L74","documentation":"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.","triggerScenarios":"Running the skaffold-sync goal (or Skaffold dev with sync enabled) on a Maven project whose <packaging> is not 'jar'.","commonSituations":"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.","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."],"exampleFix":"// before\n<packaging>war</packaging>\n// after\n<packaging>jar</packaging>","handlingStrategy":"validation","validationCode":"boolean syncSupported = \"jar\".equals(project.getPackaging());\nif (!syncSupported) throw new IllegalStateException(\"Skaffold sync requires <packaging>jar</packaging>\");","typeGuard":null,"tryCatchPattern":"try { ... } catch (MojoExecutionException e) { if (e.getMessage().contains(\"only available for 'jar' style\")) { /* disable sync for this module */ } }","preventionTips":["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"],"tags":["maven","skaffold","packaging","sync"],"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"}