apache/maven · warning
%s %s encountered while building the effective model for %s
Error message
%s %s encountered while building the effective model for %s during %s
What it means
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.
Source
Thrown at compat/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java:255
// that may lead to unexpected build failure, log them
if (!modelResult.getProblems().isEmpty()) {
List<ModelProblem> problems = modelResult.getProblems();
if (logger.isDebugEnabled()) {
String problem = (problems.size() == 1) ? "problem" : "problems";
String problemPredicate = problem + ((problems.size() == 1) ? " was" : " were");
StringBuilder message = new StringBuilder(String.format(
"%s %s encountered while building the effective model for %s during %s\n",
problems.size(),
problemPredicate,
request.getArtifact(),
RequestTraceHelper.interpretTrace(true, request.getTrace())));
message.append(StringUtils.capitalizeFirstLetter(problem));
for (ModelProblem modelProblem : problems) {
message.append(String.format(
"\n* %s @ %s",
modelProblem.getMessage(), ModelProblemUtils.formatLocation(modelProblem, null)));
}
logger.warn(message.toString());
} else {
logger.warn(
"{} {} encountered while building the effective model for {} during {} (use -X to see details)",
problems.size(),
(problems.size() == 1) ? "problem was" : "problems were",
request.getArtifact(),
RequestTraceHelper.interpretTrace(false, request.getTrace()));
}
}
model = modelResult.getEffectiveModel();
} catch (ModelBuildingException e) {
for (ModelProblem problem : e.getProblems()) {
if (problem.getException() instanceof UnresolvableModelException unresolvableModelException) {
result.addException(unresolvableModelException);
throw new ArtifactDescriptorException(result);
}
}
invalidDescriptor(session, trace, a, e);View on GitHub (pinned to e4093d4e12)
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.
Example fix
# before mvn verify # after: get the detailed problem list mvn verify -X 2>&1 | sed -n '/encountered while building the effective model/,/^$/p' # then pin a version whose POM resolves cleanly: # <dependencyManagement><dependency> # <groupId>bad.group</groupId><artifactId>bad-artifact</artifactId><version>1.1</version> # </dependency></dependencyManagement>
Defensive patterns
Strategy: validation
Validate before calling
# preflight: make sure the dependency POM and its parents resolve cleanly mvn -q dependency:get -Dartifact=com.example:dep:1.0.0:pom && echo 'descriptor OK'
Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- {} {} encountered while building the effective model for {}
- Unable to build project
- \n\tArtifact {} retains local artifactScope '{}' overriding
- Repository list contains duplicate entries. Each repository
- Repository list contains null entries. All repository entrie
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/815cc1391a8c740e.
Report an issue: GitHub.