apache/maven · warning

Total model problems reported: {}

Error message

Total model problems reported: {}

What it means

Trailer of the model-problem report: after all projects have been scanned, DefaultProjectsSelector sums every project's problem counts and, when the total is greater than zero, prints this line with the aggregate number. It exists so a multi-module build with many small warnings is still visible as a total. It is always followed by the two advisory lines about build stability and future Maven support.

Source

Thrown at impl/maven-core/src/main/java/org/apache/maven/project/collector/DefaultProjectsSelector.java:91

                LOGGER.warn("");
                LOGGER.warn(
                        "{} {} encountered while building the effective model for '{}' (use -e to see details)",
                        problemsCount,
                        (problemsCount == 1) ? "problem was" : "problems were",
                        result.getProjectId());

                if (request.isShowErrors()) { // this means -e or -X (as -X enables -e as well)
                    for (ModelProblem problem : result.getProblems()) {
                        String loc = ModelProblemUtils.formatLocation(problem, result.getProjectId());
                        LOGGER.warn("{}{}", problem.getMessage(), ((loc != null && !loc.isEmpty()) ? " @ " + loc : ""));
                    }
                }
            }
        }

        if (totalProblemsCount > 0) {
            LOGGER.warn("");
            LOGGER.warn("Total model problems reported: {}", totalProblemsCount);
            LOGGER.warn("");
            LOGGER.warn("It is highly recommended to fix these problems"
                    + " because they threaten the stability of your build.");
            LOGGER.warn("");
            LOGGER.warn("For this reason, future Maven versions might no"
                    + " longer support building such malformed projects.");
            LOGGER.warn("");
        }

        return projects;
    }
}

View on GitHub (pinned to e4093d4e12)

Solutions

  1. Run with -e to enumerate the individual problems and the projects that own them
  2. Drive the total to zero by fixing the cited problems module by module
  3. If a problem is unavoidable (third-party parent POM), pin a corrected version or override the offending model section in your own POM

Example fix

# before: only the total is known
mvn clean install
# [WARNING] Total model problems reported: 5

# after: attribute problems to modules and fix them
mvn -e clean install 2>&1 | grep 'problem.*encountered'
Defensive patterns

Strategy: validation

Validate before calling

# Enforce zero total model problems in CI (bash)
mvn -e clean verify 2>&1 | tee build.log
if grep -q 'Total model problems reported' build.log; then
  echo '::error::Maven reported model problems'; exit 1
fi

Prevention

When it happens

Trigger: Any build via the projects collector where totalProblemsCount > 0 after iterating all ProjectBuildingResults, i.e. at least one model problem anywhere in the reactor, even if all are warnings.

Common situations: Large multi-module builds where each module contributes one or two benign warnings; threshold-based CI checks that fail the build when the reported total exceeds a limit.

Related errors


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/c2d201a46f0847d5. Report an issue: GitHub.