{"record":{"id":"a1c727ac99b3df55","repo":"apache/maven","slug":"the-requested-required-projects-do-not-exist","errorCode":null,"errorMessage":"The requested required projects {} do not exist.","messagePattern":"The requested required projects (.+?) do not exist\\.","errorType":"exception","errorClass":"MavenExecutionException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/graph/ProjectSelector.java","lineNumber":74,"sourceCode":"                Optional<MavenProject> optSelectedProject =\n                        findOptionalProjectBySelector(projects, baseDirectory, selector);\n                if (optSelectedProject.isPresent()) {\n                    resolvedOptionalProjects.add(optSelectedProject.get());\n                    if (activation.activationSettings().recurse()) {\n                        resolvedOptionalProjects.addAll(getChildProjects(optSelectedProject.get(), request));\n                    }\n                } else {\n                    unresolvedSelectors.add(activation);\n                }\n            }\n        }\n        if (!unresolvedSelectors.isEmpty()) {\n            String requiredSelectors = unresolvedSelectors.stream()\n                    .filter(pas -> !pas.activationSettings().optional())\n                    .map(ProjectActivation.ProjectActivationSettings::selector)\n                    .collect(Collectors.joining(\", \"));\n            if (!requiredSelectors.isEmpty()) {\n                throw new MavenExecutionException(\n                        \"The requested required projects \" + requiredSelectors + \" do not exist.\", request.getPom());\n            } else {\n                String optionalSelectors = unresolvedSelectors.stream()\n                        .map(ProjectActivation.ProjectActivationSettings::selector)\n                        .collect(Collectors.joining(\", \"));\n                LOGGER.info(\"The requested optional projects {} do not exist.\", optionalSelectors);\n            }\n        }\n\n        return resolvedOptionalProjects;\n    }\n\n    /**\n     * @deprecated use {@link #getActiveProjects(MavenExecutionRequest, List, List)}\n     */\n    @Deprecated(since = \"4.0.0\")\n    public Set<MavenProject> getRequiredProjectsBySelectors(\n            MavenExecutionRequest request, List<MavenProject> projects, Set<String> projectSelectors)","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/graph/ProjectSelector.java#L56-L92","documentation":"MavenExecutionException listing all REQUIRED project selectors that matched no project in the reactor. ProjectSelector.getActiveProjects() resolves each -pl selector (':artifactId', 'groupId:artifactId', or a path relative to the request base directory) and collects unmatched ones; selectors marked optional (-pl '?name') only log an info message, but required unmatched selectors fail the build with this joined list.","triggerScenarios":"mvn -pl :artifactId or -pl relative/path where no reactor project has that artifactId, groupId:artifactId, or a basedir/pom file matching the selector path resolved against the base directory; the path branch also matches a selector that points at a pom file.","commonSituations":"Typos in module names or artifactIds; modules deactivated by their activation profiles; running from a subdirectory so relative path selectors no longer resolve; modules renamed during refactoring while CI commands were not updated.","solutions":["List the reactor modules (build summary or the pom <modules>) and fix the selector spelling","Run from the reactor root so relative-path selectors resolve, or switch to the ':artifactId' form","If the module's presence is conditional, mark the selector optional: -pl '?module' so its absence only logs","Ensure any profile needed to include the module in the reactor is enabled"],"exampleFix":"# before: module renamed, selector no longer matches\nmvn -pl :old-name install\n\n# after: selector matches a reactor module\nmvn -pl :new-name install","handlingStrategy":"validation","validationCode":"// Resolve each selector against the known reactor before running Maven\nboolean matches = projects.stream().anyMatch(p ->\n    (\":\" + p.getArtifactId()).equals(selector)\n    || (p.getGroupId() + \":\" + p.getArtifactId()).equals(selector)\n    || pathMatches(p, selector, baseDir));\nif (!matches && !selector.startsWith(\"?\")) {\n    throw new IllegalArgumentException(\"Selector matches no reactor project: \" + selector);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run -pl from the reactor root or use ':artifactId' form","Mark possibly-absent modules optional: -pl '?module'","Update CI selection commands whenever modules are renamed"],"tags":["maven","projects-option","reactor","project-selection","cli"],"backgroundTag":"unknown-module-selection","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}