[MNG-8092] Only warn about extension in reactor for projects actually built - #13290
UsmanEjaz10 wants to merge 1 commit into
Conversation
…he active Projects only
gnodet-bot
left a comment
There was a problem hiding this comment.
Clean fix. Moving the extension-in-reactor validation after all reactor trimming steps (trimProjectsToRequest, trimSelectedProjects, trimResumedProjects, trimExcludedProjects) is the right approach — excluded modules should not trigger false-positive warnings.
The Set<String> simplification (replacing the unused Map<String, MavenProject>) and dropping the MavenExecutionRequest parameter + throws clause are good cleanup — the old method only ever called containsKey, never used the MavenProject value, and the exception was only declared because of the now-removed getProjectsInRequestScope call.
IT coverage looks solid: the existing test verifies the warning is still emitted for a full reactor build, and the new test block verifies it's suppressed when the plugin module is excluded via -pl !plugin.
Note: PR #13241 addresses the same issue but retains vestigial complexity (unused MavenExecutionRequest param, Map instead of Set, unnecessary throws clause). This PR is the cleaner of the two.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
How & Why
build()(which ran prematurely on all initial reactor projects) intoreactorDependencyGraph()right after all project trimming/exclusion steps (trimProjectsToRequest,trimSelectedProjects,trimResumedProjects, andtrimExcludedProjects), evaluating onlyactiveProjects.validateExtensionIsNotPartOfReactorand simplified reactor key matching to a cleanSet<String>lookup over active projects, backed by integration test coverage inMavenITmng5572ReactorPluginExtensionsTest.