{"record":{"id":"f747de8ccefbade4","repo":"GoogleContainerTools/jib","slug":"failed-to-calculate-execution-plan","errorCode":null,"errorMessage":"failed to calculate execution plan","messagePattern":"failed to calculate execution plan","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/PackageGoalsMojo.java","lineNumber":66,"sourceCode":"  @VisibleForTesting static final String GOAL_NAME = \"_skaffold-package-goals\";\n\n  @Nullable @Component private LifecycleExecutor lifecycleExecutor;\n\n  @Nullable\n  @Parameter(defaultValue = \"${session}\", readonly = true)\n  private MavenSession session;\n\n  @Override\n  public void execute() throws MojoExecutionException, MojoFailureException {\n    Preconditions.checkNotNull(lifecycleExecutor);\n    Preconditions.checkNotNull(session);\n    checkJibVersion();\n\n    MavenExecutionPlan mavenExecutionPlan;\n    try {\n      mavenExecutionPlan = lifecycleExecutor.calculateExecutionPlan(session, \"package\");\n    } catch (Exception ex) {\n      throw new MojoExecutionException(\"failed to calculate execution plan\", ex);\n    }\n\n    mavenExecutionPlan.getMojoExecutions().stream()\n        .filter(mojoExecution -> \"package\".equals(mojoExecution.getLifecyclePhase()))\n        .filter(\n            mojoExecution ->\n                MavenProjectProperties.PLUGIN_NAME.equals(\n                    mojoExecution.getPlugin().getArtifactId()))\n        .map(MojoExecution::getGoal)\n        .forEach(System.out::println);\n  }\n}\n","sourceCodeStart":48,"sourceCodeEnd":79,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/PackageGoalsMojo.java#L48-L79","documentation":"PackageGoalsMojo (_skaffold-list-package-goals) asks Maven's lifecycle executor to calculate the 'package' execution plan so it can list the goals that will run. If plan calculation throws for any reason, the exception is wrapped in this MojoExecutionException. The cause carries the underlying lifecycle/plugin problem.","triggerScenarios":"Executing _skaffold-list-package-goals when lifecycleExecutor.calculateExecutionPlan(session, \"package\") throws — e.g. a malformed pom, a plugin/goal referenced in the lifecycle that cannot be loaded, or an extension/plugin configuration error.","commonSituations":"Broken plugin declarations or invalid pom.xml elements in a multi-module Skaffold project; incompatible Maven extensions; corrupt local plugin metadata in ~/.m2.","solutions":["Run 'mvn package -X' (or mvn -e) and fix the underlying error shown as the cause of the failed plan calculation.","Validate pom.xml — remove malformed plugin executions/configurations and stale references.","Clear corrupted plugin metadata: delete the relevant artifact directories under ~/.m2/repository and rebuild with -U.","Align Maven and plugin versions (mvn -v) since very old Maven cores can fail with newer plugins."],"exampleFix":"// before (malformed plugin goal in pom)\n<execution><goals><goal>not-a-goal</goal></goals></execution>\n// after\n<execution><goals><goal>build</goal></goals></execution>","handlingStrategy":"validation","validationCode":"// Before running the goals-listing goal, verify the package plan computes:\n// mvn package -DskipTests -Djib.skip=true   (any failure here is the root cause)","typeGuard":null,"tryCatchPattern":"try { ... } catch (MojoExecutionException e) { if (e.getMessage().contains(\"failed to calculate execution plan\")) { /* inspect e.getCause() and fix the pom/plugin error it reports */ } }","preventionTips":["Keep pom.xml plugin executions/goals valid — remove references to nonexistent goals","Run a plain 'mvn package' in CI to catch lifecycle issues before Skaffold","Clear ~/.m2 plugin metadata after upgrade failures","Use a supported Maven version for your plugin set"],"tags":["maven","skaffold","lifecycle","build-plan"],"backgroundTag":"invalid-config-value","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"}