gnodet opened a new pull request, #13639: URL: https://github.com/apache/maven/pull/13639
Backport of #13605 to `maven-4.0.x`. ## Problem `MavenProject#getPluginManagement()` can return `null` when `pluginManagement` is absent from the effective model (e.g. after it was removed from the Super POM). Plugins that call this method typically assume a non-null return value, leading to `NullPointerException`s. ## Fix Return an empty `PluginManagement` instead of `null`, consistent with how `getModelBuild()` already ensures a non-null `Build`. The implementation was slightly compacted compared to the 3.10.x version to stay within the 2 000-line checkstyle limit on `MavenProject.java`. ## Test coverage Added `MavenProjectTest#pluginManagementShouldReturnNotNull` — verifies that a fresh `MavenProject` (no build, no pluginManagement) returns a non-null `PluginManagement`. --- Port of 3.10.x fix (commit 835209b, author: Slawomir Jaranowski). -- 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]
