GoogleContainerTools/jib · error · MojoExecutionException
failed to calculate execution plan
Error message
failed to calculate execution plan
What it means
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.
Source
Thrown at jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/skaffold/PackageGoalsMojo.java:66
@VisibleForTesting static final String GOAL_NAME = "_skaffold-package-goals";
@Nullable @Component private LifecycleExecutor lifecycleExecutor;
@Nullable
@Parameter(defaultValue = "${session}", readonly = true)
private MavenSession session;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
Preconditions.checkNotNull(lifecycleExecutor);
Preconditions.checkNotNull(session);
checkJibVersion();
MavenExecutionPlan mavenExecutionPlan;
try {
mavenExecutionPlan = lifecycleExecutor.calculateExecutionPlan(session, "package");
} catch (Exception ex) {
throw new MojoExecutionException("failed to calculate execution plan", ex);
}
mavenExecutionPlan.getMojoExecutions().stream()
.filter(mojoExecution -> "package".equals(mojoExecution.getLifecyclePhase()))
.filter(
mojoExecution ->
MavenProjectProperties.PLUGIN_NAME.equals(
mojoExecution.getPlugin().getArtifactId()))
.map(MojoExecution::getGoal)
.forEach(System.out::println);
}
}
View on GitHub (pinned to fb949e2676)
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.
Example fix
// before (malformed plugin goal in pom) <execution><goals><goal>not-a-goal</goal></goals></execution> // after <execution><goals><goal>build</goal></goals></execution>
Defensive patterns
Strategy: validation
Validate before calling
// Before running the goals-listing goal, verify the package plan computes: // mvn package -DskipTests -Djib.skip=true (any failure here is the root cause)
Try / catch
try { ... } catch (MojoExecutionException e) { if (e.getMessage().contains("failed to calculate execution plan")) { /* inspect e.getCause() and fix the pom/plugin error it reports */ } } Prevention
- 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
When it happens
Trigger: 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.
Common situations: Broken plugin declarations or invalid pom.xml elements in a multi-module Skaffold project; incompatible Maven extensions; corrupt local plugin metadata in ~/.m2.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- 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
- ${ex.getMessage()}
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/f747de8ccefbade4.
Report an issue: GitHub.