[ https://issues.apache.org/jira/browse/MENFORCER-447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17651671#comment-17651671 ]
Pavel Horal edited comment on MENFORCER-447 at 12/23/22 2:54 PM: ----------------------------------------------------------------- The rule {{requirePluginVersions}} is not able to pick up versions specified in the parent POM. The issue is demonstrated in my test repository https://github.com/pavelhoral/enforcer-plugin-test . I have tried to find the issue and so far got to this call that incorrectly returns empty optional - [PluginWrapper.java#L75|https://github.com/apache/maven-enforcer/blob/374d7d6a98fb9a33e5740936d612eadfce9cbb66/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java#L75] (called from here [RequirePluginVersions.java#L881|https://github.com/apache/maven-enforcer/blob/374d7d6a98fb9a33e5740936d612eadfce9cbb66/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L881]). By the way the JavaDoc of that method is not correct as empty optional is not the same as null result. *Update:* Plugin model entity does not have {{locations}} property set. Without that enforcer is not able to tell where the plugin is defined. was (Author: pavel.horal): The rule {{requirePluginVersions}} is not able to pick up versions specified in the parent POM. The issue is demonstrated in my test repository https://github.com/pavelhoral/enforcer-plugin-test . I have tried to find the issue and so far got to this call that incorrectly returns empty optional - [PluginWrapper.java#L75|https://github.com/apache/maven-enforcer/blob/374d7d6a98fb9a33e5740936d612eadfce9cbb66/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java#L75] (called from here [RequirePluginVersions.java#L881|https://github.com/apache/maven-enforcer/blob/374d7d6a98fb9a33e5740936d612eadfce9cbb66/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L881]). By the way the JavaDoc of that method is not correct as empty optional is not the same as null result. *Update:* Plugin model entity does not have {{location}} property set. Without that enforcer is not able to tell where the plugin is defined. > Verify working with Maven 4 > --------------------------- > > Key: MENFORCER-447 > URL: https://issues.apache.org/jira/browse/MENFORCER-447 > Project: Maven Enforcer Plugin > Issue Type: Task > Reporter: Slawomir Jaranowski > Assignee: Slawomir Jaranowski > Priority: Major > Fix For: 3.2.0 > > -- This message was sent by Atlassian Jira (v8.20.10#820010)