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

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

Author: vsiveton
Date: Wed Aug  6 04:01:17 2008
New Revision: 683221

URL: http://svn.apache.org/viewvc?rev=683221&view=rev
Log:
MPH-29: help:describe should be way more helpful when no arguments are provided

o improved the error message

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=683221&r1=683220&r2=683221&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 Wed Aug  6 04:01:17 2008
@@ -312,8 +312,15 @@
         }
         else
         {
-            throw new MojoFailureException(
-                                            "You must either specify \'groupId\' and \'artifactId\', or a valid \'plugin\' parameter." );
+            StringBuffer msg = new StringBuffer();
+            msg.append( "You must either specify 'groupId' and 'artifactId' both parameters, or a valid 'plugin' " +
+                    "parameter. For instance:\n" );
+            msg.append( "  # mvn help:describe -Dplugin=org.apache.maven.plugins:maven-help-plugin\n" );
+            msg.append( "or\n" );
+            msg.append( "  # mvn help:describe -DgroupId=org.apache.maven.plugins -DartifactId=maven-help-plugin\n\n" );
+            msg.append( "Try 'mvn help:help -Ddetail=true' for more informations." );
+
+            throw new MojoFailureException( msg.toString() );
         }
 
         if ( descriptor == null && forLookup != null )