{"record":{"id":"3c1b7a7eb21185c8","repo":"apache/maven","slug":"the-following-dependencies-could-not-be-resolved-a","errorCode":null,"errorMessage":"The following dependencies could not be resolved at this point of the build but seem to be part of the reactor:","messagePattern":"The following dependencies could not be resolved at this point of the build but seem to be part of the reactor:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java","lineNumber":270,"sourceCode":"        DependencyResolutionResult result;\n        try {\n            DefaultDependencyResolutionRequest request =\n                    new DefaultDependencyResolutionRequest(project, session.getRepositorySession());\n            request.setResolutionFilter(resolutionFilter);\n\n            eventSpyDispatcher.onEvent(request);\n\n            result = dependenciesResolver.resolve(request);\n        } catch (DependencyResolutionException e) {\n            result = e.getResult();\n\n            /*\n             * MNG-2277, the check below compensates for our bad plugin support where we ended up with aggregator\n             * plugins that require dependency resolution, although they usually run in phases of the build where project\n             * artifacts haven't been assembled yet. The prime example of this is \"mvn release:prepare\".\n             */\n            if (aggregating && areAllDependenciesInReactor(session.getProjects(), result.getUnresolvedDependencies())) {\n                logger.warn(\"The following dependencies could not be resolved at this point of the build\"\n                        + \" but seem to be part of the reactor:\");\n\n                for (Dependency dependency : result.getUnresolvedDependencies()) {\n                    logger.warn(\"o {}\", dependency);\n                }\n\n                logger.warn(\"Try running the build up to the lifecycle phase \\\"package\\\"\");\n            } else {\n                throw new LifecycleExecutionException(messageBuilderFactory, null, project, e);\n            }\n        }\n\n        eventSpyDispatcher.onEvent(result);\n\n        Set<Artifact> artifacts = new LinkedHashSet<>();\n        if (result.getDependencyGraph() != null\n                && !result.getDependencyGraph().getChildren().isEmpty()) {\n            RepositoryUtils.toArtifacts(","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java#L252-L288","documentation":"MNG-2277 compensation: an aggregating mojo (or one with requiresProject=false) triggered project dependency resolution at a point in the build where reactor artifacts have not been assembled yet (e.g. from clean). If every unresolved dependency is itself a reactor module, Maven does not fail - it warns that resolution is impossible 'at this point', lists the unresolved reactor dependencies, and hints to build up to 'package' first.","triggerScenarios":"Running mvn release:prepare (the prime example) or another aggregator goal directly after clean on a multi-module reactor: project artifacts are not yet in the reactor's assembled state nor in the local repo, so scope+dependency resolution fails for sibling modules.","commonSituations":"mvn clean release:prepare / release:perform on fresh checkouts; CI pipelines invoking aggregating reporting or release plugins as the very first command; any aggregator that declares it needs runtime dependencies of all modules.","solutions":["Build to package (or install) before the aggregating goal: mvn clean install once, then mvn release:prepare","Upgrade the aggregating plugin - newer m-release-p versions defer dependency resolution and avoid the trap","Configure the aggregating mojo to not require dependency resolution (fork a phase like package instead of resolve dependencies)","As a last resort run the aggregator with -N or against an already-installed reactor"],"exampleFix":"# before\nmvn clean release:prepare   # warns: reactor deps unresolved at this point\n# after\nmvn clean install\nmvn release:prepare","handlingStrategy":"validation","validationCode":"# pipeline guard: ensure reactor artifacts exist before aggregating goals\nif [ ! -d \"$HOME/.m2/repository/com/acme/parent/1.0\" ]; then\n  mvn -q clean install -DskipTests\nfi\nmvn release:prepare","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run mvn install (or at least package) before release:prepare or similar aggregators","Upgrade maven-release-plugin to a version that defers dependency resolution","Never start a fresh checkout directly with an aggregator goal from clean"],"tags":["aggregator","dependency-resolution","reactor","release-plugin","mng-2277"],"backgroundTag":"aggregator-dependency-resolution","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}