{"record":{"id":"1733b9e841fc2841","repo":"apache/maven","slug":"encountered-while-building-the-effective-mod-1733b9","errorCode":null,"errorMessage":"{} {} encountered while building the effective model for '{}' (use -e to see details)","messagePattern":"(.+?) (.+?) encountered while building the effective model for '(.+?)' \\(use -e to see details\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"impl/maven-core/src/main/java/org/apache/maven/project/collector/DefaultProjectsSelector.java","lineNumber":74,"sourceCode":"            throws ProjectBuildingException {\n        ProjectBuildingRequest projectBuildingRequest = request.getProjectBuildingRequest();\n\n        boolean hasProjectSelection = !request.getProjectActivation().isEmpty();\n        boolean isRecursive = hasProjectSelection || request.isRecursive();\n        List<ProjectBuildingResult> results = projectBuilder.build(files, isRecursive, projectBuildingRequest);\n\n        List<MavenProject> projects = new ArrayList<>(results.size());\n\n        long totalProblemsCount = 0;\n\n        for (ProjectBuildingResult result : results) {\n            projects.add(result.getProject());\n\n            int problemsCount = result.getProblems().size();\n            totalProblemsCount += problemsCount;\n            if (problemsCount != 0 && LOGGER.isWarnEnabled()) {\n                LOGGER.warn(\"\");\n                LOGGER.warn(\n                        \"{} {} encountered while building the effective model for '{}' (use -e to see details)\",\n                        problemsCount,\n                        (problemsCount == 1) ? \"problem was\" : \"problems were\",\n                        result.getProjectId());\n\n                if (request.isShowErrors()) { // this means -e or -X (as -X enables -e as well)\n                    for (ModelProblem problem : result.getProblems()) {\n                        String loc = ModelProblemUtils.formatLocation(problem, result.getProjectId());\n                        LOGGER.warn(\"{}{}\", problem.getMessage(), ((loc != null && !loc.isEmpty()) ? \" @ \" + loc : \"\"));\n                    }\n                }\n            }\n        }\n\n        if (totalProblemsCount > 0) {\n            LOGGER.warn(\"\");\n            LOGGER.warn(\"Total model problems reported: {}\", totalProblemsCount);\n            LOGGER.warn(\"\");","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/project/collector/DefaultProjectsSelector.java#L56-L92","documentation":"After selecting the projects for the reactor, DefaultProjectsSelector counted ProjectBuildingResult problems for a project and found at least one. The warning states how many problems (singular/plural verb is chosen) were recorded while building that project's effective model; the details are only listed when -e or -X is enabled. The build still proceeds unless one of the problems had ERROR severity, in which case ProjectBuildingException is thrown separately.","triggerScenarios":"mvn <goals> on a single- or multi-module request where any produced ProjectBuildingResult carries problems: malformed POM values, deprecated constructs, unresolvable parents, validation warnings from model validators. The count is result.getProblems().size(), summed across projects for the trailing banner.","commonSituations":"CI log audits reacting to the word 'problem'; builds mixing plugin versions with malformed <configuration>; projects relying on lenient parsing that newer Maven validators flag; after a Maven upgrade that tightened model validation.","solutions":["Re-run the same command with -e (or -X) to make Maven print each problem message with its location on the next lines","Fix the reported problems at the cited file/line, starting with any ERROR severity entries","If problems come from a parent or BOM, fix them at the source and rebuild with -U to refresh snapshots"],"exampleFix":"# before: problems hidden behind the summary\nmvn clean install\n\n# after: show every model problem with its location\nmvn -e clean install","handlingStrategy":"validation","validationCode":"// Embedding Maven: inspect problems before using the selected projects\nList<ProjectBuildingResult> results = projectBuilder.build(sortedRequests, request);\nfor (ProjectBuildingResult r : results) {\n    List<ModelProblem> fatal = r.getProblems().stream()\n            .filter(p -> p.getSeverity() == Severity.ERROR).toList();\n    if (!fatal.isEmpty()) fail(\"model errors in \" + r.getProjectId() + \": \" + fatal);\n    else if (!r.getProblems().isEmpty()) warn(\"{} model problems in {}\", r.getProblems().size(), r.getProjectId());\n}","typeGuard":null,"tryCatchPattern":"// Catch the aggregate failure and enumerate problems like the -e listing\ntry {\n    List<MavenProject> projects = projectBuilder.build(request); // collector path\n} catch (ProjectBuildingException e) {\n    for (ModelProblem p : e.getProblems()) {\n        System.err.printf(\"%s @ %s%n\", p.getMessage(),\n                org.apache.maven.model.building.ModelProblemUtils.formatLocation(p, e.getProjectId()));\n    }\n}","preventionTips":["Always develop and debug with -e so problem details are printed next to the summary","Add a CI grep for 'encountered while building the effective model' and fail on match","Fix model problems immediately after Maven upgrades; validators get stricter across versions"],"tags":["maven","model-building","reactor","validation"],"backgroundTag":"maven-model-problems","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}