You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2018/03/04 19:45:59 UTC

[maven-help-plugin] 01/01: [MPH-134] Drop deprecated alias 'mojo'

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MPH-134
in repository https://gitbox.apache.org/repos/asf/maven-help-plugin.git

commit 5fa89b52dd676568e7aed51fd5d73e10e55520c8
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun Mar 4 20:44:14 2018 +0100

    [MPH-134] Drop deprecated alias 'mojo'
---
 .../test.properties                                |  2 +-
 src/it/describe-prefix-and-mojo/test.properties    |  2 +-
 .../apache/maven/plugins/help/DescribeMojo.java    | 34 ++++++++++------------
 src/site/apt/examples/describe-configuration.apt   | 10 +++----
 src/site/apt/index.apt.vm                          |  4 +--
 src/site/apt/usage.apt                             |  8 ++---
 6 files changed, 28 insertions(+), 32 deletions(-)

diff --git a/src/it/describe-prefix-and-invalid-mojo/test.properties b/src/it/describe-prefix-and-invalid-mojo/test.properties
index 78640a1..e4a47f0 100644
--- a/src/it/describe-prefix-and-invalid-mojo/test.properties
+++ b/src/it/describe-prefix-and-invalid-mojo/test.properties
@@ -16,4 +16,4 @@
 # under the License.
 
 plugin = help
-mojo = invalid
+goal = invalid
diff --git a/src/it/describe-prefix-and-mojo/test.properties b/src/it/describe-prefix-and-mojo/test.properties
index 9f0ecd7..c038f75 100644
--- a/src/it/describe-prefix-and-mojo/test.properties
+++ b/src/it/describe-prefix-and-mojo/test.properties
@@ -16,4 +16,4 @@
 # under the License.
 
 plugin = help
-mojo = describe
+goal = describe
diff --git a/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java b/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java
index 61ca458..9932470 100644
--- a/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java
+++ b/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java
@@ -91,37 +91,37 @@ public class DescribeMojo
      * For deprecated values
      */
     private static final String NO_REASON = "No reason given";
-    
+
     private static final Pattern EXPRESSION = Pattern.compile( "^\\$\\{([^}]+)\\}$" );
 
     // ----------------------------------------------------------------------
     // Mojo components
     // ----------------------------------------------------------------------
-    
+
     /**
      * Component used to get a plugin descriptor from a given plugin.
      */
     @Component
     private MavenPluginManagerHelper pluginManager;
-    
+
     /**
      * Component used to get a plugin by its prefix and get mojo descriptors.
      */
     @Component
     private MojoDescriptorCreator mojoDescriptorCreator;
-    
+
     /**
      * Component used to resolve the version for a plugin.
      */
     @Component
     private PluginVersionResolver pluginVersionResolver;
-    
+
     /**
      * The Maven default built-in lifecycles.
      */
     @Component
     private DefaultLifecycles defaultLifecycles;
-    
+
     /**
      * A map from each packaging to its lifecycle mapping.
      */
@@ -182,9 +182,9 @@ public class DescribeMojo
      * If this parameter is specified, only the corresponding goal (Mojo) will be described,
      * rather than the whole Plugin.
      *
-     * @since 2.1, was <code>mojo</code> in 2.0.x
+     * @since 2.1
      */
-    @org.apache.maven.plugins.annotations.Parameter( property = "goal", alias = "mojo" )
+    @org.apache.maven.plugins.annotations.Parameter( property = "goal" )
     private String goal;
 
     /**
@@ -250,7 +250,7 @@ public class DescribeMojo
                 MojoDescriptor mojo = descriptor.getMojo( goal );
                 if ( mojo == null )
                 {
-                    throw new MojoFailureException( "The mojo '" + goal + "' does not exist in the plugin '"
+                    throw new MojoFailureException( "The goal '" + goal + "' does not exist in the plugin '"
                         + pi.getPrefix() + "'" );
                 }
                 describeMojo( mojo, descriptionBuffer );
@@ -273,11 +273,7 @@ public class DescribeMojo
      */
     private void validateParameters()
     {
-        // support legacy parameters "mojo" and "full"
-        if ( goal == null && session.getUserProperties().get( "mojo" ) != null )
-        {
-            goal = session.getUserProperties().getProperty( "mojo" );
-        }
+        // support legacy parameter "full"
 
         if ( !detail && session.getUserProperties().get( "full" ) != null )
         {
@@ -308,7 +304,7 @@ public class DescribeMojo
             }
             catch ( IOException e )
             {
-                throw new MojoExecutionException( "Cannot write plugin/mojo description to output: " + output, e );
+                throw new MojoExecutionException( "Cannot write plugin/goal description to output: " + output, e );
             }
 
             getLog().info( "Wrote descriptions to: " + output );
@@ -604,11 +600,11 @@ public class DescribeMojo
 
         if ( StringUtils.isNotEmpty( eGoal ) || StringUtils.isNotEmpty( ePhase ) )
         {
-            append( buffer, "Before this mojo executes, it will call:", 1 );
+            append( buffer, "Before this goal executes, it will call:", 1 );
 
             if ( StringUtils.isNotEmpty( eGoal ) )
             {
-                append( buffer, "Single mojo", "'" + eGoal + "'", 2 );
+                append( buffer, "Single goal", "'" + eGoal + "'", 2 );
             }
 
             if ( StringUtils.isNotEmpty( ePhase ) )
@@ -1003,7 +999,7 @@ public class DescribeMojo
     /**
      * Determines if this Mojo should be used as a report or not. This resolves the plugin project along with all of its
      * transitive dependencies to determine if the Java class of this goal implements <code>MavenReport</code>.
-     * 
+     *
      * @param md Mojo descriptor
      * @return Whether or not this goal should be used as a report.
      */
@@ -1040,7 +1036,7 @@ public class DescribeMojo
     /**
      * Transforms the given plugin descriptor into an artifact coordinate. It is formed by its GAV information, along
      * with the given type.
-     * 
+     *
      * @param pd Plugin descriptor.
      * @param type Extension for the coordinate.
      * @return Coordinate of an artifact having the same GAV as the given plugin descriptor, with the given type.
diff --git a/src/site/apt/examples/describe-configuration.apt b/src/site/apt/examples/describe-configuration.apt
index fa0facd..92cb6e1 100644
--- a/src/site/apt/examples/describe-configuration.apt
+++ b/src/site/apt/examples/describe-configuration.apt
@@ -63,15 +63,15 @@ Configuring Describe Goal
 # mvn help:describe -Dplugin=help
 +---+
 
-* The <<<mojo>>> Parameter
+* The <<<goal>>> Parameter
 
- You can use the <<<mojo>>> parameter of the <<<describe>>> goal to show or display relative information about a
+ You can use the <<<goal>>> parameter of the <<<describe>>> goal to show or display relative information about a
  particular goal of the plugin you specified.
 
  For example, when you execute the following command:
 
 +-----+
-# mvn help:describe -Dmojo=describe -DgroupId=org.apache.maven.plugins -DartifactId=maven-help-plugin
+# mvn help:describe -Dgoal=describe -DgroupId=org.apache.maven.plugins -DartifactId=maven-help-plugin
 +-----+
 
  This would display brief information about the <<<describe>>> goal only.
@@ -173,7 +173,7 @@ For more information, run 'mvn help:describe [...] -Ddetail'
 ...
 +-----+
 
- The <<<medium>>> parameter is the default since 2.1 and adds a list with the mojos of the plugin and their
+ The <<<medium>>> parameter is the default since 2.1 and adds a list with the goals of the plugin and their
  descriptions:
 
 +-----+
@@ -242,7 +242,7 @@ For more information, run 'mvn help:describe [...] -Ddetail'
 ...
 +-----+
 
- The <<<full>>> parameter also displays information about the mojos's implementation, their parameters and component
+ The <<<full>>> parameter also displays information about the goal's implementation, their parameters and component
  requirements, among others.
 
 +-----+
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
index fb0057b..0384db1 100644
--- a/src/site/apt/index.apt.vm
+++ b/src/site/apt/index.apt.vm
@@ -30,7 +30,7 @@
 ${project.name}
 
  The Maven Help Plugin is used to get relative information about a project or the system. It can be used to get a
- description of a particular plugin, including the plugin's mojos with their parameters and component requirements,
+ description of a particular plugin, including the plugin's goals with their parameters and component requirements,
  the effective POM and effective settings of the current build, and the profiles applied to the current project being
  built.
 
@@ -61,7 +61,7 @@ ${project.name}
 * Major Version Upgrade to version 3.0.0
 
   Please note that the goal <<<expressions>>> has been completely removed from the plugin. All the Maven expressions
-  that are supported as plugin parameters are available in the Javadoc of the 
+  that are supported as plugin parameters are available in the Javadoc of the
   {{{/ref/current/maven-core/apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html}
   <<<PluginParameterExpressionEvaluator>>>}} class.
 
diff --git a/src/site/apt/usage.apt b/src/site/apt/usage.apt
index 37b48bb..e61239a 100644
--- a/src/site/apt/usage.apt
+++ b/src/site/apt/usage.apt
@@ -63,9 +63,9 @@ Usage
 * The <<<help:describe>>> Goal
 
   The <<<{{{./describe-mojo.html}describe}}>>> goal is used to discover information about Maven plugins. Given either
-  a <<<plugin>>> or a <<<groupId>>>, an <<<artifactId>>> and optionally a <<<version>>>, the mojo will lookup that
-  plugin and output details about it. If the user also specifies which <<<mojo>>> to describe, the <<<describe>>>
-  mojo will limit output to the details of that mojo, including parameters.
+  a <<<plugin>>> or a <<<groupId>>>, an <<<artifactId>>> and optionally a <<<version>>>, the goal will lookup that
+  plugin and output details about it. If the user also specifies which <<<goal>>> to describe, the <<<describe>>>
+  goal will limit output to the details of that goal, including parameters.
 
   You can execute this goal using the following command:
 
@@ -143,6 +143,6 @@ null object or invalid expression
  The <<<artifact>>> parameter refers to ask expressions on the artifact POM. If omitted, the evaluate goal uses the current
  pom.
 
- You could ask for all Maven expressions listed in the Javadoc of the 
+ You could ask for all Maven expressions listed in the Javadoc of the
  {{{/ref/current/maven-core/apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html}
  <<<PluginParameterExpressionEvaluator>>>}} class.

-- 
To stop receiving notification emails like this one, please contact
michaelo@apache.org.