You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2011/03/05 22:44:17 UTC

svn commit: r1078367 - in /maven/plugins/branches/maven-site-plugin-3.x: ./ src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java

Author: ltheussl
Date: Sat Mar  5 21:44:16 2011
New Revision: 1078367

URL: http://svn.apache.org/viewvc?rev=1078367&view=rev
Log:
merge r1055033 from trunk

Modified:
    maven/plugins/branches/maven-site-plugin-3.x/   (props changed)
    maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java

Propchange: maven/plugins/branches/maven-site-plugin-3.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Mar  5 21:44:16 2011
@@ -1 +1 @@
-/maven/plugins/trunk/maven-site-plugin:801155,801171,801470,806898-806906,807943-808180,809252,810298,884137,886844,886847,890094,890124,891014,891688,920027,920041,942622,943455,944145,950463,956681,984466,984960,984991,984996,1029307,1033379,1037476,1039137,1039143,1049020,1051139-1051449,1055019
+/maven/plugins/trunk/maven-site-plugin:801155,801171,801470,806898-806906,807943-808180,809252,810298,884137,886844,886847,890094,890124,891014,891688,920027,920041,942622,943455,944145,950463,956681,984466,984960,984991,984996,1029307,1033379,1037476,1039137,1039143,1049020,1051139-1051449,1055019,1055033

Modified: maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java?rev=1078367&r1=1078366&r2=1078367&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java (original)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java Sat Mar  5 21:44:16 2011
@@ -163,11 +163,6 @@ public class SiteDeployMojo
     public void execute()
         throws MojoExecutionException
     {
-        if ( !inputDirectory.exists() )
-        {
-            throw new MojoExecutionException( "The site does not exist, please run site:site first" );
-        }
-
         DistributionManagement distributionManagement = project.getDistributionManagement();
 
         if ( distributionManagement == null )
@@ -192,9 +187,30 @@ public class SiteDeployMojo
             throw new MojoExecutionException( "The URL to the site is missing in the project descriptor." );
         }
         getLog().debug( "The site will be deployed to url '" + url + "' with id '" + id + "'");
+        getLog().debug( "Using credentials from repository '" + id + "'" );
 
-        Repository repository = new Repository( id, url );
+        deployTo( id, url );
+    }
 
+    /**
+     * Use wagon to deploy the generated site to a given repository.
+     *
+     * @param id the id that is used to look up credentials for the deploy. Not null.
+     * @param url a valid scm url to deploy to. Not null.
+     *
+     * @throws MojoExecutionException if the deploy fails.
+     *
+     * @since 2.3
+     */
+    protected void deployTo( final String id, final String url )
+            throws MojoExecutionException
+    {
+        if ( !inputDirectory.exists() )
+        {
+            throw new MojoExecutionException( "The site does not exist, please run site:site first" );
+        }
+
+        Repository repository = new Repository( id, url );
         // TODO: work on moving this into the deployer like the other deploy methods
 
         Wagon wagon;