Author: evenisse Date: Tue May 22 07:32:28 2007 New Revision: 540597 URL: http://svn.apache.org/viewvc?view=rev&rev=540597 Log: Allow to configure the provider implementation to use in the plugin conf.
Modified: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java maven/scm/trunk/maven-scm-plugin/src/site/apt/examples/scm-advance-features.apt Modified: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java?view=diff&rev=540597&r1=540596&r2=540597 ============================================================================== --- maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java (original) +++ maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java Tue May 22 07:32:28 2007 @@ -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 @@ -174,6 +181,18 @@ String value = systemProperties.getProperty( key ); 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 ); } } } Modified: maven/scm/trunk/maven-scm-plugin/src/site/apt/examples/scm-advance-features.apt URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/site/apt/examples/scm-advance-features.apt?view=diff&rev=540597&r1=540596&r2=540597 ============================================================================== --- maven/scm/trunk/maven-scm-plugin/src/site/apt/examples/scm-advance-features.apt (original) +++ maven/scm/trunk/maven-scm-plugin/src/site/apt/examples/scm-advance-features.apt Tue May 22 07:32:28 2007 @@ -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