apache/maven · warning

{}{}

Error message

{}{}

What it means

This is the per-problem detail line that DefaultProjectsSelector prints for each ModelProblem when request.isShowErrors() is true (i.e. -e or -X, since -X implies -e). The first placeholder is the problem's own message; the second is ' @ <location>' formatted by ModelProblemUtils.formatLocation() with the projectId, or empty when the problem has no location. It appears only under the '{}' problem-count warning for the same project.

Source

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

        long totalProblemsCount = 0;

        for (ProjectBuildingResult result : results) {
            projects.add(result.getProject());

            int problemsCount = result.getProblems().size();
            totalProblemsCount += problemsCount;
            if (problemsCount != 0 && LOGGER.isWarnEnabled()) {
                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. Read the problem text and the @ location suffix, then fix the named POM at the given line
  2. For problems without a location, run with -X for the full stack context of the model builder
  3. Re-run the build after each fix to confirm the problem count drops to zero

Example fix

# before
mvn clean install
# [WARNING] 2 problems encountered while building the effective model for 'com.example:app'

# after: details with location are printed
mvn -e clean install
# [WARNING] 'dependencies.dependency.version' is missing @ com.example:app:jar:1.0, line 42, column 21
Defensive patterns

Strategy: validation

Validate before calling

// Fail CI when any model problem line would be printed
List<ModelProblem> problems = result.getProblems();
if (!problems.isEmpty()) {
    problems.forEach(p -> log.warn("{} @ {}", p.getMessage(),
            ModelProblemUtils.formatLocation(p, result.getProjectId())));
    throw new IllegalStateException("effective model has " + problems.size() + " problem(s)");
}

Prevention

When it happens

Trigger: Any reactor build run with -e or -X where at least one ProjectBuildingResult has problems; one line is emitted per problem, in the order they were collected during model building of that project.

Common situations: Developer runs mvn -e to diagnose a build failure and sees the raw model problem text; messages like 'Unknown packaging: bundle' or 'Invalid version' are surfaced here with the exact POM file and line.

Related errors


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