{"record":{"id":"a6f351926baf1173","repo":"apache/maven","slug":"failed-to-build-parent-project-for","errorCode":null,"errorMessage":"Failed to build parent project for {}","messagePattern":"Failed to build parent project for (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"impl/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java","lineNumber":1078,"sourceCode":"                            throw new IllegalArgumentException(\n                                    \"Unsupported repository merging: \" + request.getRepositoryMerging());\n                    }\n\n                    // Store the computed repositories for this project in BuildSession storage\n                    // to avoid mutating the shared request and causing leakage between projects\n                    projectRepositories.put(project.getId(), mergedRepositories);\n\n                    Path parentPomFile = parentModel.getPomFile();\n                    if (parentPomFile != null) {\n                        project.setParentFile(parentPomFile.toFile());\n                        try {\n                            parent = build(true, parentPomFile, Sources.buildSource(parentPomFile))\n                                    .getProject();\n                        } catch (ProjectBuildingException e) {\n                            // MNG-4488 where let invalid parents slide on by\n                            if (logger.isDebugEnabled()) {\n                                // Message below is checked for in the MNG-2199 core IT.\n                                logger.warn(\"Failed to build parent project for \" + project.getId(), e);\n                            } else {\n                                // Message below is checked for in the MNG-2199 core IT.\n                                logger.warn(\"Failed to build parent project for \" + project.getId());\n                            }\n                        }\n                    } else {\n                        Artifact parentArtifact = project.getParentArtifact();\n                        try {\n                            parent = build(true, parentArtifact, false, getEffectiveRepositories(project.getId()))\n                                    .getProject();\n                        } catch (ProjectBuildingException e) {\n                            // MNG-4488 where let invalid parents slide on by\n                            if (logger.isDebugEnabled()) {\n                                // Message below is checked for in the MNG-2199 core IT.\n                                logger.warn(\"Failed to build parent project for \" + project.getId(), e);\n                            } else {\n                                // Message below is checked for in the MNG-2199 core IT.\n                                logger.warn(\"Failed to build parent project for \" + project.getId());","sourceCodeStart":1060,"sourceCodeEnd":1096,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java#L1060-L1096","documentation":"While assembling a project's effective model, DefaultProjectBuilder recursively builds the <parent>. Under the MNG-4488 policy an invalid parent does not abort the child: ProjectBuildingException is caught, this warning is logged, and building continues with parent = null. This variant is the debug-enabled form for the branch where the parent is backed by a pom.xml file (resolved via relativePath, parentPomFile != null); the message text is deliberately stable because MNG-2199 core ITs assert on it.","triggerScenarios":"A module whose <parent><relativePath> (default ../pom.xml) points at a POM that itself fails to build - malformed XML, unresolvable ITS parent, invalid model - during any reactor build, with -X enabled so the stack trace prints. The child continues but loses the parent's packaging, properties, dependencyManagement and pluginManagement.","commonSituations":"relativePath left at default while the parent sits elsewhere; a parent POM edited and broken locally; refactors where the parent file moved; consequences surface later as missing properties or 'Invalid packaging' errors far from the cause.","solutions":["Run with -X and read the appended ProjectBuildingException - it states the real reason the parent failed to build; fix that first","Verify <parent> coordinates and <relativePath>: point it at the real parent file, or set <relativePath/> (empty) to force repository resolution instead of the filesystem","If the parent must come from a repository, make sure it is installed/deployed (mvn -N install in the parent directory) and reachable with -U","Do not ignore the degraded state: without the parent, effective-model correctness is not guaranteed - expect and chase follow-up errors"],"exampleFix":"<!-- before: default relativePath ../pom.xml does not point at the real parent -->\n<parent>\n  <groupId>com.corp</groupId>\n  <artifactId>corp-parent</artifactId>\n  <version>2.1</version>\n</parent>\n<!-- after: empty relativePath forces repository lookup for the parent -->\n<parent>\n  <groupId>com.corp</groupId>\n  <artifactId>corp-parent</artifactId>\n  <version>2.1</version>\n  <relativePath/>\n</parent>","handlingStrategy":"validation","validationCode":"# preflight: the parent referenced at relativePath must exist and parse\nchild=pom.xml\nrel=$(xmllint --xpath 'string(/*[local-name()=\"project\"]/*[local-name()=\"parent\"]/*[local-name()=\"relativePath\"])' \"$child\")\nrel=${rel:-../pom.xml}\ntest -f \"$rel\" && xmllint --noout \"$rel\" && echo parent-ok || echo \"parent file missing/invalid at $rel\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set <relativePath> explicitly when the parent is not at ../pom.xml, or empty it to force repository resolution","Build the parent first in CI (mvn -N install) so children can always resolve it","Never rely on the MNG-4488 leniency - a swallowed parent failure produces a degraded model and delayed errors"],"tags":["maven","parent-pom","project-building","mng-4488"],"backgroundTag":"parent-pom-resolution-failed","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}