devesh95official opened a new pull request, #1097: URL: https://github.com/apache/maven-enforcer/pull/1097
Part of #1096 (the `MavenProject.getReportPlugins()` row). `RequireSameVersions` called the deprecated `MavenProject.getReportPlugins()`, which in Maven 3 is just `getModel().getReporting().getPlugins()`, or an empty list when the POM has no `<reporting>` section. The rule now reads that directly through a small private helper, so behavior is the same. The test stubbed `project.getReportPlugins()`; it now stubs `project.getModel()` (an empty `Model` by default), and two new tests cover a report plugin whose version comes from the `<reporting>` section: matching the build plugin passes, a different version fails. The other items in #1096 (`getReportArtifacts()`, `getDependencyArtifacts()`, `ArtifactFactory`/`PluginManager`, `getContainer()`) are left for separate PRs, since each needs its own replacement. Tested locally (JDK 21, Maven 3.9.9): `mvn verify -Prun-its -Dinvoker.test='require-same-versions*'`, so all 317 enforcer-rules tests, the 29 plugin tests and the three `require-same-versions` integration tests pass, along with spotless and the other checks in `verify`. --- To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) check one of the following: - [x] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) - [ ] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
