Author: jdcasey
Date: Tue Jul  8 10:52:52 2008
New Revision: 674898

URL: http://svn.apache.org/viewvc?rev=674898&view=rev
Log:
[MNG-3511] Improve the output when no goal is specified.

Modified:
    
maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java

Modified: 
maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
URL: 
http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=674898&r1=674897&r2=674898&view=diff
==============================================================================
--- 
maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
 (original)
+++ 
maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
 Tue Jul  8 10:52:52 2008
@@ -131,7 +131,27 @@
 
         if ( goals.isEmpty() )
         {
-            throw new BuildFailureException( "\n\nYou must specify at least 
one goal. Try 'mvn install' to build or 'mvn -?' for options \nSee 
http://maven.apache.org for more information.\n\n" );
+            StringBuffer buffer = new StringBuffer( 1024 );
+
+            buffer.append( "\n\n" );
+            buffer.append( "You must specify at least one goal or lifecycle 
phase to perform build steps.\n" );
+            buffer.append( "The following list illustrates some commonly used 
build commands:\n\n" );
+            buffer.append( "  mvn clean\n" );
+            buffer.append( "    Deletes any build output (e.g. class files or 
JARs).\n" );
+            buffer.append( "  mvn test\n" );
+            buffer.append( "    Runs the unit tests for the project.\n" );
+            buffer.append( "  mvn install\n" );
+            buffer.append( "    Copies the project artifacts into your local 
repository.\n" );
+            buffer.append( "  mvn deploy\n" );
+            buffer.append( "    Copies the project artifacts into the remote 
repository.\n" );
+            buffer.append( "  mvn site\n" );
+            buffer.append( "    Creates project documentation (e.g. reports or 
Javadoc).\n\n" );
+            buffer.append( "Please see\n" );
+            buffer.append( 
"http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html\n";
 );
+            buffer.append( "for a complete description of available lifecycle 
phases.\n\n" );
+            buffer.append( "Use \"mvn -?\" to show general usage information 
about Maven's command line.\n\n" );
+
+            throw new BuildFailureException( buffer.toString() );
         }
 
         List taskSegments = segmentTaskListByAggregationNeeds( goals, session, 
rootProject );


Reply via email to