{"record":{"id":"2edfda9bdb704211","repo":"apache/maven","slug":"findmandatoryroot-failed","errorCode":null,"errorMessage":"findMandatoryRoot failed","messagePattern":"findMandatoryRoot failed","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"impl/maven-impl/src/main/java/org/apache/maven/impl/model/rootlocator/DefaultRootLocator.java","lineNumber":75,"sourceCode":"        return rootDirectory;\n    }\n\n    @Nonnull\n    @Override\n    public Path findMandatoryRoot(@Nonnull Path basedir) {\n        Path rootDirectory = findRoot(basedir);\n        Optional<Path> rdf = getRootDirectoryFallback();\n        if (rootDirectory == null) {\n            rootDirectory = rdf.orElseThrow(() -> new IllegalStateException(getNoRootMessage()));\n            logger.warn(getNoRootMessage());\n        } else {\n            if (rdf.isPresent()) {\n                try {\n                    if (!Files.isSameFile(rootDirectory, rdf.orElseThrow())) {\n                        logger.warn(\"Project root directory and multiModuleProjectDirectory are not aligned\");\n                    }\n                } catch (IOException e) {\n                    throw new IllegalStateException(\"findMandatoryRoot failed\", e);\n                }\n            }\n        }\n        return rootDirectory;\n    }\n\n    protected boolean isRootDirectory(Path dir) {\n        requireNonNull(dir, \"dir is null\");\n        for (RootDetector rootDetector : rootDetectors) {\n            if (rootDetector.isRootDirectory(dir)) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    protected Optional<Path> getRootDirectoryFallback() {\n        String mmpd = System.getProperty(\"maven.multiModuleProjectDirectory\");","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-impl/src/main/java/org/apache/maven/impl/model/rootlocator/DefaultRootLocator.java#L57-L93","documentation":"Error \"findMandatoryRoot failed\" thrown in apache/maven.","triggerScenarios":"Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/model/rootlocator/DefaultRootLocator.java:75 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}