{"record":{"id":"815cc1391a8c740e","repo":"apache/maven","slug":"s-s-encountered-while-building-the-effective-mod","errorCode":null,"errorMessage":"%s %s encountered while building the effective model for %s during %s\n","messagePattern":"(.+?) (.+?) encountered while building the effective model for (.+?) during (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"compat/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java","lineNumber":255,"sourceCode":"                // that may lead to unexpected build failure, log them\n                if (!modelResult.getProblems().isEmpty()) {\n                    List<ModelProblem> problems = modelResult.getProblems();\n                    if (logger.isDebugEnabled()) {\n                        String problem = (problems.size() == 1) ? \"problem\" : \"problems\";\n                        String problemPredicate = problem + ((problems.size() == 1) ? \" was\" : \" were\");\n                        StringBuilder message = new StringBuilder(String.format(\n                                \"%s %s encountered while building the effective model for %s during %s\\n\",\n                                problems.size(),\n                                problemPredicate,\n                                request.getArtifact(),\n                                RequestTraceHelper.interpretTrace(true, request.getTrace())));\n                        message.append(StringUtils.capitalizeFirstLetter(problem));\n                        for (ModelProblem modelProblem : problems) {\n                            message.append(String.format(\n                                    \"\\n* %s @ %s\",\n                                    modelProblem.getMessage(), ModelProblemUtils.formatLocation(modelProblem, null)));\n                        }\n                        logger.warn(message.toString());\n                    } else {\n                        logger.warn(\n                                \"{} {} encountered while building the effective model for {} during {} (use -X to see details)\",\n                                problems.size(),\n                                (problems.size() == 1) ? \"problem was\" : \"problems were\",\n                                request.getArtifact(),\n                                RequestTraceHelper.interpretTrace(false, request.getTrace()));\n                    }\n                }\n                model = modelResult.getEffectiveModel();\n            } catch (ModelBuildingException e) {\n                for (ModelProblem problem : e.getProblems()) {\n                    if (problem.getException() instanceof UnresolvableModelException unresolvableModelException) {\n                        result.addException(unresolvableModelException);\n                        throw new ArtifactDescriptorException(result);\n                    }\n                }\n                invalidDescriptor(session, trace, a, e);","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java#L237-L273","documentation":"Emitted by the artifact descriptor reader while it resolves a dependency's POM: building the effective model for that artifact produced ModelProblem entries (bad parent, unresolvable import, invalid values) yet a usable effective model was still returned, so Maven logs a WARN instead of failing. This is the detailed (-X / debug enabled) variant: it lists every problem with its POM location so the offending POM can be fixed. Dependency resolution then continues with the partially-built model.","triggerScenarios":"Reading an artifact descriptor whose model building reports problems but does not throw ModelBuildingException: dependency POM resolving to a non-strict parent version, a dependencyManagement import that cannot be resolved, a parent missing along relativePath, or leniently tolerated XML issues. Occurs during dependency resolution of reactor or repository artifacts with debug logging on.","commonSituations":"A published dependency whose parent POM was never published; mirrors or proxies serving only part of a POM hierarchy; POMs relying on properties that do not resolve; after upgrading a dependency whose old POM references an internal parent not present on reachable repositories.","solutions":["Re-run the same command with -X (or -e) to get this detailed list with exact POM locations, and note which artifact each '* problem @ location' line names.","If the offending POM belongs to a dependency, change its version in dependencyManagement to one with a valid, publishable POM, or exclude it if transitive.","Verify the parent POM and its ancestors exist in the repositories Maven actually reaches (check mirrors, proxies, and repository listings in settings.xml).","If the POM is yours, publish the parent chain or use flatten-maven-plugin so installed/deployed POMs are self-contained."],"exampleFix":"# before\nmvn verify\n# after: get the detailed problem list\nmvn verify -X 2>&1 | sed -n '/encountered while building the effective model/,/^$/p'\n# then pin a version whose POM resolves cleanly:\n# <dependencyManagement><dependency>\n#   <groupId>bad.group</groupId><artifactId>bad-artifact</artifactId><version>1.1</version>\n# </dependency></dependencyManagement>","handlingStrategy":"validation","validationCode":"# preflight: make sure the dependency POM and its parents resolve cleanly\nmvn -q dependency:get -Dartifact=com.example:dep:1.0.0:pom && echo 'descriptor OK'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Publish self-contained POMs (flatten-maven-plugin) so parents never go missing","Pin dependency versions in dependencyManagement and review effective POM changes on upgrade","Run builds with -X in CI nightly so hidden model problems surface with locations"],"tags":["maven","pom","dependency-resolution","model-building"],"backgroundTag":"invalid-pom-model","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}