From 4d00ebee3777c6567119d3a9baf035b13ba859de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Mon, 25 Mar 2024 23:22:28 +0100 Subject: [PATCH] [MNG-4840] fix requiredMavenVersion description #1444 --- .../apache/maven/plugin/descriptor/PluginDescriptor.java | 8 +++++--- .../maven/plugin/descriptor/PluginDescriptorBuilder.java | 2 ++ maven-plugin-api/src/main/mdo/plugin.mdo | 9 --------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java index 85e289bfb5f5..88a2481f5300 100644 --- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java +++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java @@ -77,7 +77,7 @@ public class PluginDescriptor extends ComponentSetDescriptor implements Cloneabl private String description; - // MNG-4840 + // MNG-4840: set from plugin's pom.xml, not plugin.xml private String requiredMavenVersion; private Plugin plugin; @@ -297,17 +297,19 @@ public String getDescription() { } /** - * Set required Maven version. + * Set required Maven version, as defined in plugin's pom.xml (not plugin.xml). * * @param requiredMavenVersion Maven version required by the plugin * @since 3.0.2 */ + // used by maven-core's org.apache.maven.plugin.internal.DefaultMavenPluginManager#getPluginDescriptor(...) + // but NOT PluginDescriptorBuilder public void setRequiredMavenVersion(String requiredMavenVersion) { this.requiredMavenVersion = requiredMavenVersion; } /** - * Get required Maven version. + * Get required Maven version, as defined in plugin's pom.xml (not plugin.xml). * * @return the Maven version required by the plugin * @since 3.0.2 diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java index 6ef3e0f26649..5d603e769b9e 100644 --- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java +++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java @@ -32,6 +32,8 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException; /** + * Build plugin descriptor object from {@code plugin.xml}. + * * @author Jason van Zyl */ public class PluginDescriptorBuilder { diff --git a/maven-plugin-api/src/main/mdo/plugin.mdo b/maven-plugin-api/src/main/mdo/plugin.mdo index 4ccc632b3d6b..5232e6a4aea2 100644 --- a/maven-plugin-api/src/main/mdo/plugin.mdo +++ b/maven-plugin-api/src/main/mdo/plugin.mdo @@ -92,15 +92,6 @@ under the License. boolean true - - requiredMavenVersion - 1.0.0 - - Minimum Maven version required to use the plugin. - @since Maven 3.0.2 - - String - mojos 1.0.0