You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2011/07/30 15:42:03 UTC

svn commit: r1152461 - /maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java

Author: hboutemy
Date: Sat Jul 30 13:42:02 2011
New Revision: 1152461

URL: http://svn.apache.org/viewvc?rev=1152461&view=rev
Log:
improved error message when site deploy protocol is unavailable
Submitted by: Lukas Theussl (yes, we found a solution matching our complementary expectations)

Modified:
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java?rev=1152461&r1=1152460&r2=1152461&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java (original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java Sat Jul 30 13:42:02 2011
@@ -359,16 +359,15 @@ public abstract class AbstractDeployMojo
                 "Unsupported protocol: '" + repository.getProtocol() + "' for site deployment to "
                     + "distributionManagement.site.url=" + repository.getUrl() + ".";
             String longMessage =
-                "Supported protocols at this moment: " + getSupportedProtocols( log ) + ".\n"
-                    + "    You can add protocols through wagon providers either as maven-site-plugin dependency or "
-                    + "extension.\n"
+                "\n" + shortMessage + "\n" +
+                "Currently supported protocols are: " + getSupportedProtocols() + ".\n"
+                    + "    Protocols may be added through wagon providers.\n"
                     + "    For more information, see "
                     + "http://maven.apache.org/plugins/maven-site-plugin/examples/adding-deploy-protocol.html";
 
-            log.error( shortMessage );
             log.error( longMessage );
 
-            throw new MojoExecutionException( null, shortMessage, "\n" + shortMessage + "\n" + longMessage );
+            throw new MojoExecutionException( shortMessage );
         }
         catch ( TransferFailedException e )
         {
@@ -384,7 +383,7 @@ public abstract class AbstractDeployMojo
         return wagon;
     }
 
-    private String getSupportedProtocols( final Log log )
+    private String getSupportedProtocols()
     {
         try
         {
@@ -395,7 +394,7 @@ public abstract class AbstractDeployMojo
         catch ( ComponentLookupException e )
         {
             // in the unexpected case there is a problem when instantiating a wagon provider
-            log.error( e );
+            getLog().error( e );
         }
         return "";
     }