You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by df...@apache.org on 2008/08/29 06:51:11 UTC

svn commit: r690098 - /maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java

Author: dfabulich
Date: Thu Aug 28 21:51:10 2008
New Revision: 690098

URL: http://svn.apache.org/viewvc?rev=690098&view=rev
Log:
[MPH-33] Help plugin should refer to "goal" not "mojo".  Also now we refer to "detail" rather than "full", to match help:help

Modified:
    maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java

Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java?rev=690098&r1=690097&r2=690098&view=diff
==============================================================================
--- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java (original)
+++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java Thu Aug 28 21:51:10 2008
@@ -183,16 +183,16 @@
      * If this parameter is specified, only the corresponding Mojo (goal) will be described,
      * rather than the whole Plugin.
      *
-     * @parameter expression="${mojo}"
+     * @parameter expression="${goal}"
      */
-    private String mojo;
+    private String goal;
 
     /**
      * This flag specifies that a full (verbose) list of Mojo informations should be given.
      *
-     * @parameter expression="${full}" default-value="false"
+     * @parameter expression="${detail}" default-value="false"
      */
-    private boolean full;
+    private boolean detail;
 
     /**
      * This flag specifies that a medium list of Mojo informations should be given.
@@ -258,9 +258,9 @@
 
             PluginDescriptor descriptor = lookupPluginDescriptor( pi );
 
-            if ( StringUtils.isNotEmpty( mojo ) )
+            if ( StringUtils.isNotEmpty( goal ) )
             {
-                describeMojo( descriptor.getMojo( mojo ), descriptionBuffer );
+                describeMojo( descriptor.getMojo( goal ), descriptionBuffer );
             }
             else
             {
@@ -280,7 +280,19 @@
      */
     private void validateParameters()
     {
-        if ( full || minimal )
+        // support legacy parameters "mojo" and "full"
+        if ( goal == null && session.getExecutionProperties().get( "mojo" ) != null )
+        {
+            goal = session.getExecutionProperties().getProperty( "mojo" );
+        }
+        
+        if ( !detail && session.getExecutionProperties().get( "full" ) != null )
+        {
+            String full = session.getExecutionProperties().getProperty( "full" );
+            detail = Boolean.parseBoolean( full );
+        }
+        
+        if ( detail || minimal )
         {
             medium = false;
         }
@@ -503,7 +515,7 @@
         appendAsParagraph( buffer, "Description", toDescription( pd.getDescription() ), 0 );
         buffer.append( "\n" );
 
-        if ( ( full || medium ) && !minimal )
+        if ( ( detail || medium ) && !minimal )
         {
             append( buffer, "This plugin has " + pd.getMojos().size() + " goals:", 0 );
             buffer.append( "\n" );
@@ -512,7 +524,7 @@
             {
                 MojoDescriptor md = (MojoDescriptor) it.next();
 
-                if ( full )
+                if ( detail )
                 {
                     describeMojoGuts( md, buffer, true );
                 }
@@ -525,9 +537,9 @@
             }
         }
 
-        if ( !full )
+        if ( !detail )
         {
-            buffer.append( "For more information, run 'mvn help:describe [...] -Dfull'" );
+            buffer.append( "For more information, run 'mvn help:describe [...] -Ddetail'" );
             buffer.append( "\n" );
         }
     }
@@ -546,12 +558,12 @@
         buffer.append( "Mojo: '" ).append( md.getFullGoalName() ).append( "'" );
         buffer.append( '\n' );
 
-        describeMojoGuts( md, buffer, full );
+        describeMojoGuts( md, buffer, detail );
         buffer.append( "\n" );
 
-        if ( !full )
+        if ( !detail )
         {
-            buffer.append( "For more information, run 'mvn help:describe [...] -Dfull'" );
+            buffer.append( "For more information, run 'mvn help:describe [...] -Ddetail'" );
             buffer.append( "\n" );
         }
     }
@@ -844,7 +856,7 @@
 
         descriptionBuffer.append( "'" + cmd + "' is a plugin goal (aka mojo)" ).append( ".\n" );
         plugin = mojoDescriptor.getPluginDescriptor().getId();
-        mojo = mojoDescriptor.getGoal();
+        goal = mojoDescriptor.getGoal();
 
         return true;
     }