About Pluggable SCM Library

In brief, Pluggable SCM allows user to use their own desired SCM provider, currently BitBucket , Gitlab and Gerrit are supported.

By enabling a standard interface, Java reflection can be used to return dynamic groovy closures in cartridge which would act the same as default DSL methods depending on the SCM provider.

There are two parts of ADOP that are affected by using this library:

The pluggable.scm package contains:

  • SCMProvider - an interface which defines the specification of an SCM provider
  • SCMProviderDataStore - an interface for SCM provider data store specification
  • SCMProviderFactory - an interface for SCM provider factory definition responsible for parsing the providers properties and instantiating the correct SCM provider
  • SCMProviderHandler - a class responsible for dispatching SCM provider requests to the correct SCM provider factory
  • SCMProviderInfo - annotation to mark SCM providers

More specific information can be found in Javadocs

Using Pluggable SCM Library

To use this library you will need to create your own classes which then would implement above interfaces. For example

  public class GitlabSCMProviderFactory implements SCMProviderFactory {}

Then use the factory method to return the instantiated SCM provider with the provided properties

  public SCMProvider create(Properties scmProviderProperties) {}

from where your GitlabSCMProvider will read properties like :

  • Host
  • Port
  • Protocol (https, http or ssh)
  • User
  • Endpoint etc.

The same way it should be done for example using SCMProvider interface

  public class GitlabSCMProvider implements SCMProvider {}

and proceed with defining your own classes for creating repositories etc. and defining get and trigger closures.


More info: