Allow to configure the provider implementation to use in the plugin conf.

git-svn-id: https://svn.apache.org/repos/asf/maven/scm/trunk@540597 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
index 40dceba..5d94711 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
@@ -41,6 +41,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.Iterator;
+import java.util.Map;
 import java.util.Properties;
 
 /**
@@ -158,6 +159,12 @@
      */
     private Properties systemProperties;
 
+    /**
+     * List of provider implementations.
+     *
+     * @parameter
+     */
+    private Map providerImplementations;
 
     public void execute()
         throws MojoExecutionException
@@ -176,6 +183,18 @@
                 System.setProperty( key, value );
             }
         }
+
+        if ( providerImplementations != null )
+        {
+            for ( Iterator i = providerImplementations.keySet().iterator(); i.hasNext(); )
+            {
+                String providerType = (String) i.next();
+                String providerImplementation = (String) providerImplementations.get( providerType );
+                getLog().info( "Change the default '" + providerType + "' provider implementation to '" +
+                    providerImplementation + "'." );
+                getScmManager().setScmProviderImplementation( providerType, providerImplementation );
+            }
+        }
     }
 
     protected void setConnectionType( String connectionType )
diff --git a/maven-scm-plugin/src/site/apt/examples/scm-advance-features.apt b/maven-scm-plugin/src/site/apt/examples/scm-advance-features.apt
index 7a641c2..47c34ef 100644
--- a/maven-scm-plugin/src/site/apt/examples/scm-advance-features.apt
+++ b/maven-scm-plugin/src/site/apt/examples/scm-advance-features.apt
@@ -24,6 +24,30 @@
   [...]
 +---------+
 
+ If you want to change the default scm provider implementation, for exemple you want to use the native cvs
+ instead of the pure java implementation, you must configure your plugin like that:
+
++-----------+
+[...]
+   <build>
+   [...]
+      <plugins>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-scm-plugin</artifactId>
+            <configuration>
+               <providerImplementations>
+                 <cvs>cvs_native</cvs>
+               </providerImplementations>
+            </configuration>
+         </plugin>
+         [...]
+      </plugins
+   [...]
+   </build> 
+[...]
++-----------+  
+
  Once the scm has been configured, scm operations can be performed.
   
 * changelog - displays the project commit changes for each revisions