Author: bentmann
Date: Fri Apr 10 22:42:19 2009
New Revision: 764090

URL: http://svn.apache.org/viewvc?rev=764090&view=rev
Log:
[MSITE-400] Make repository id for stage-deploy configurable

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

Modified: 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java?rev=764090&r1=764089&r2=764090&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java
 Fri Apr 10 22:42:19 2009
@@ -74,6 +74,16 @@
     private String stagingSiteURL;
 
     /**
+     * The identifier of the repository where the staging site will be 
deployed. This id will be used to lookup a
+     * corresponding <code>&lt;server&gt;</code> entry from the 
<code>settings.xml</code>. If a matching
+     * <code>&lt;server&gt;</code> entry is found, its configured credentials 
will be used for authentication.
+     * 
+     * @parameter expression="${stagingRepositoryId}" 
default-value="stagingSite"
+     * @since 2.0.1
+     */
+    private String stagingRepositoryId;
+
+    /**
      * @component
      */
     private WagonManager wagonManager;
@@ -89,8 +99,6 @@
 
     private PlexusContainer container;
 
-    private static final String STAGING_SERVER_ID = "stagingSite";
-
     /**
      * @see org.apache.maven.plugin.Mojo#execute()
      */
@@ -116,13 +124,13 @@
         stagingSiteURL = getStagingSiteURL( project, reactorProjects, 
stagingSiteURL );
         getLog().info( "Using this URL for staging: " + stagingSiteURL );
 
-        Repository repository = new Repository( STAGING_SERVER_ID, 
stagingSiteURL );
+        Repository repository = new Repository( stagingRepositoryId, 
stagingSiteURL );
 
         Wagon wagon;
         try
         {
             wagon = wagonManager.getWagon( repository );
-            SiteDeployMojo.configureWagon( wagon, STAGING_SERVER_ID, settings, 
container, getLog() );
+            SiteDeployMojo.configureWagon( wagon, stagingRepositoryId, 
settings, container, getLog() );
         }
         catch ( UnsupportedProtocolException e )
         {
@@ -150,11 +158,11 @@
             ProxyInfo proxyInfo = SiteDeployMojo.getProxyInfo( repository, 
wagonManager );
             if ( proxyInfo != null )
             {
-                wagon.connect( repository, wagonManager.getAuthenticationInfo( 
STAGING_SERVER_ID ), proxyInfo );
+                wagon.connect( repository, wagonManager.getAuthenticationInfo( 
stagingRepositoryId ), proxyInfo );
             }
             else
             {
-                wagon.connect( repository, wagonManager.getAuthenticationInfo( 
STAGING_SERVER_ID ) );
+                wagon.connect( repository, wagonManager.getAuthenticationInfo( 
stagingRepositoryId ) );
             }
 
             wagon.putDirectory( new File( stagingDirectory, getStructure( 
project, false ) ), "." );


Reply via email to