New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNG-4840] document requiredMavenVersion in plugin descriptor #1444
Conversation
@hboutemy I am confused by this PR. MNG-4840 iss not about plugin descriptors but about POMs. The required Maven version in plugin descriptors has been added in https://issues.apache.org/jira/browse/MNG-7570 just recently and is only evaluated in Maven4+. |
I see you added the field to .mdo in https://github.com/apache/maven/pull/832/files#diff-62346c3118817c527a41027bab54349b463add4c91df98f95984012304378c87 the fact is that mdo was not used to generate code, but only to document XML against existing hand-written PluginDescriptor class https://github.com/apache/maven/blob/maven-3.9.x/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java then the missing field in 3.9 .mdo was "just" a documentation bug that I fixed in this PR: now I understand that it became a missing field in code in Maven 4, and you already added it in #832 :) |
As you can see in maven/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java Lines 42 to 106 in eae3947
maven/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java Line 191 in eae3947
Therefore I would keep documenting that this is only supported with Plugin Descriptor v1.1 and Maven 4 only. Prior it was just a shortcut for accessing the plugin's POM prerequisites element. |
history is complex: when the fiels has been introduced in 3.0.2, it has been filled 40fb188#diff-8a738ae425b439d6a5288b118ce793df13ee73db9cfcb183f7b41633e72abad9L141 not the place where I'd expect it, but used |
still there in Maven 3.9.x https://github.com/apache/maven/blob/maven-3.9.x/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java#L189 oh, now I see https://issues.apache.org/jira/browse/MNG-7570 then now I understand that documenting the field in descriptor XML is a mistake |
and re-reading Jira issue description https://issues.apache.org/jira/browse/MNG-7570 "there is currently no element for this on the plugin descriptor", it was true for 4 but not completely for 3.x (field exists in java but not XML) pfew, what a situation! |
I'll propose a PR to fix my mistakes |
https://issues.apache.org/jira/browse/MNG-4840
but not integrated in documentation until now https://maven.apache.org/ref/3.9.6/maven-plugin-api/plugin.html