The support for SCM in WSO2 Governance Registry is two fold.
- You can mount an existing SCM repository (e.g., SVN, Git) to WSO2 Governance Registry to browse and manage files through WSO2 Governance Registry.
- You can connect to WSO2 Governance Registry through a build system or CI system through the Overview of SCMs.
As the resources are maintained in the file system, it is not possible to add properties to any of the checked out resources; therefore, operations such as Mounting, Symbolic Links, and Governance will not work on resources within an SCM mount.
For more information on how to mount an existing SCM repository, please read about Configuration for Source Configuration Management (SCM). Below, we have outlined the steps on how to connect to WSO2 Governance Registry through a build system or CI system.
Configuration to create a SCM connection
1. In order to connect to WSO2 Governance Registry, you will have to add the following plugin to your POM file(s), inside the pluginManagement section. Please replace USERNAME and PASSWORD with appropriate values. More information on setting up the plugins required for establishing an SCM connection can be found in the Maven SCM plugin Usage documentation.
<pluginManagement> ... <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-scm-plugin</artifactId> <version>1.7</version> <configuration> <username>USERNAME</username> <password>PASSWORD</password> </configuration> <dependencies> <dependency> <groupId>org.wso2.governance</groupId> <version>5.2.0</version> <artifactId>checkin-client</artifactId> </dependency> </dependencies> </plugin> </plugins> ... </pluginManagement>
2. Since WSO2 plugins might not be available in the Central Maven Repository, you might have to add WSO2 repositories to your POM file(s). More information on setting up repositories can be found in the Introduction to Repositories documentation from Apache Maven.
<repositories> <repository> <id>wso2</id> <name>WSO2 Repository</name> <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url> <releases> <enabled>true</enabled> <updatePolicy>daily</updatePolicy> <checksumPolicy>ignore</checksumPolicy> </releases> </repository> </repositories>
3. Finally, you need to define the SCM connection details inside the SCM configuration element in your POM file(s). The configuration to mount the /_system/local
collection of a WSO2 Governance Registry instance running at https://localhost:9443/carbon
, would be as follows. More information on various SCM configuration options can be found in the Maven Usage.
<scm> <connection>scm:wso2:https://localhost:9443/registry/_system/local</connection> <developerConnection>scm:wso2:https://localhost:9443/registry/_system/local</developerConnection> <url>https://localhost:9443/registry/_system/local</url> </scm>
Using the SCM connection in a Build System
Once configured, you can use the SCM connection by providing the necessary SCM commands. More information on a complete list of commands and how to use them can be found in Maven SCM plugin documentation. The WSO2 Governance Registry supports the following commands:
- checkout
- checkin
- update
As an example, to take a checkout of the contents in your registry location (the one you configured above) to your filesystem, you can run the following command.
mvn scm:checkout
Note
Before you run the command above, you will have to add the GREG_HOME/bin
to your PATH
variable. Read more on how to set or change the PATH variable if you have not done this before.