dhruv9b opened a new pull request, #1024:
URL: https://github.com/apache/maven-enforcer/pull/1024

   ## Description
   
   Fixes #916.
   
   `RequireSameVersions` can incorrectly report different versions for a report 
plugin when the plugin version is managed through `<pluginManagement>`.
   
   When a report plugin is declared without an explicit version, Maven can 
expose its artifact with version `RELEASE`, even though the plugin has a 
version defined in the project's `<pluginManagement>`.
   
   For example, this can result in `RequireSameVersions` comparing:
   
   ```text
   maven-surefire-plugin        3.5.3
   maven-surefire-report-plugin RELEASE
   ```
   
   and incorrectly reporting a version mismatch.
   
   ### Changes
   
   The report-plugin version lookup now:
   
   * Uses an explicitly configured version from the reporting plugin when 
available.
   * Falls back to the version configured in the project's build 
`<pluginManagement>`.
   * Falls back to the artifact version/base version when no configured or 
managed version is available.
   
   The existing handling of `<plugins>`, `<buildPlugins>`, and 
`<reportPlugins>` is preserved.
   
   ### Tests
   
   Added a unit regression test covering a report plugin whose artifact version 
is `RELEASE` while its managed version is `3.5.3`.
   
   Added an integration test reproducing the issue with a report plugin whose 
version is provided through `<pluginManagement>`.
   
   The existing `RequireSameVersions` tests and integration tests were also run 
to ensure the changes do not regress the behavior introduced by #892, where 
entries in `<plugins>` are considered when checking build and report plugins.
   
   Fixes #916
   


-- 
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]

Reply via email to