{"record":{"id":"02e29b981797755f","repo":"apache/maven","slug":"uses-as-extension-which-is-not-possible","errorCode":null,"errorMessage":"'{}' uses '{}' as extension which is not possible within the same reactor build. This plugin was pulled from the local repository!","messagePattern":"'(.+?)' uses '(.+?)' as extension which is not possible within the same reactor build\\. This plugin was pulled from the local repository!","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"impl/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java","lineNumber":389,"sourceCode":"            throws MavenExecutionException {\n        Map<String, MavenProject> projectsMap = new HashMap<>();\n\n        List<MavenProject> projectsInRequestScope = getProjectsInRequestScope(request, projects);\n        for (MavenProject p : projectsInRequestScope) {\n            String projectKey = ArtifactUtils.key(p.getGroupId(), p.getArtifactId(), p.getVersion());\n\n            projectsMap.put(projectKey, p);\n        }\n\n        for (MavenProject project : projects) {\n            // MNG-1911 / MNG-5572: Building plugins with extensions cannot be part of reactor\n            for (Plugin plugin : project.getBuildPlugins()) {\n                if (plugin.isExtensions()) {\n                    String pluginKey =\n                            ArtifactUtils.key(plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion());\n\n                    if (projectsMap.containsKey(pluginKey)) {\n                        LOGGER.warn(\n                                \"'{}' uses '{}' as extension which is not possible within the same reactor build. \"\n                                        + \"This plugin was pulled from the local repository!\",\n                                project.getName(),\n                                plugin.getKey());\n                    }\n                }\n            }\n        }\n    }\n\n    private void processPackagingAttribute(List<MavenProject> projects, MavenExecutionRequest request)\n            throws MavenExecutionException {\n        List<MavenProject> projectsInRequestScope = getProjectsInRequestScope(request, projects);\n        for (MavenProject p : projectsInRequestScope) {\n            if (\"bom\".equals(p.getPackaging())) {\n                LOGGER.info(\n                        \"The packaging attribute of the '{}' project is configured as 'bom' and changed to 'pom'\",\n                        p.getName());","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java#L371-L407","documentation":"MNG-1911/MNG-5572: a plugin declared with <extensions>true</extensions> must extend Maven's core before the reactor builds, but if that plugin is itself a reactor module it cannot be used from the reactor. Maven takes it from the local repository instead and warns; on a machine where the plugin was never installed, the build later fails with a resolution error for that plugin.","triggerScenarios":"A multi-module build where the module producing a custom extension/plugin is listed in <modules> and that same plugin (or a sibling using it) declares it with <extensions>true</extensions> in <build><plugins>; running on a clean local repository (~/.m2 has no prior install of the plugin).","commonSituations":"Bootstrapping a repository that contains its own custom packaging or core extension; dogfooding an in-house extension inside the same reactor; fresh CI containers with an empty local repo.","solutions":["Two-phase build: first mvn install -pl <extension-module> (optionally -am), then build the full reactor - this is the standard bootstrap procedure","If you do not actually need core extension behavior, remove <extensions>true</extensions> from the plugin declaration","Pin the plugin's <version> so the local-repository fallback is deterministic, and document the pre-install step for all consumers"],"exampleFix":"<!-- before: extension plugin built in same reactor, resolved from local repo (stale or missing) -->\n<plugin>\n  <groupId>com.acme</groupId>\n  <artifactId>acme-packaging</artifactId>\n  <version>1.0</version>\n  <extensions>true</extensions>\n</plugin>\n<!-- after (if extension behavior not needed): drop the flag; otherwise pre-install the module -->\n<plugin>\n  <groupId>com.acme</groupId>\n  <artifactId>acme-packaging</artifactId>\n  <version>1.0</version>\n</plugin>\n<!-- bootstrap once: mvn install -pl acme-packaging && mvn install -->","handlingStrategy":"validation","validationCode":"# bootstrap check: verify the extension plugin is in the local repo before the reactor build\nG= com.acme; A=acme-packaging; V=1.0\n[ -d \"$HOME/.m2/repository/$G/$(echo $A | tr . /)/$V\" ] || mvn -q install -pl acme-packaging\nmvn clean install","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep extension/core-extension plugins OUT of the reactor that consumes them - build them in a separate reactor or phase","Document and script the two-phase bootstrap (install extension first, then full build)","Pin the extension plugin's version so the local-repo fallback is deterministic"],"tags":["extensions","reactor","bootstrap","build-order","mng-5572"],"backgroundTag":"reactor-build-order-dependency","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}