Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The source code of all WSO2 products as well as the scripts that are used for building WSO2 products are maintained in GitHub repositories. If you are a developer, you can easily clone the source code from these Git repositories, and if required, you can do modifications and build a customized product on your own.

...

  • Component-level repositories: A component repository consists of the source code relevant to a particular component. Each WSO2 product release is built using combinations of these component repositories. Therefore, if you want to do modifications to a particular function in a product, you need to clone the Git repositories relevant to that function. 

    For example, listed below are the main component Git repositories (but not all) that are used for WSO2 AS 5.3.0 release. The Tag ID indicates the tag from the repository that was used for the particular product release. If you want to know more about other component repositories and the tags used for a product release, send an email to dev@wso2.org.

    Git Repository NameRepository URLTag for AS 5.3.0 Release

    carbon4-kernel

    https://github.com/wso2/carbon4-kernel.git v4.4.1
    carbon-commonshttps://github.com/wso2/carbon-commons.git v4.4.7
    carbon-identityhttps://github.com/wso2/carbon-identity.gitv4.5.5 
    carbon-registryhttps://github.com/wso2/carbon-registry.git v4.4.8
    carbon-multitenancyhttps://github.com/wso2/carbon-multitenancy.git v4.4.3
    carbon-deploymenthttps://github.com/wso2/carbon-deployment.git v4.5.2
  • Product-level repository: A product repository consists of the build scripts and profiles that are used for building the product. It also includes the Integration test cases

    For example, given below is the product repository for the WSO2 AS 5.3.0 release. When you build this product repository, all the component repositories that are required for the AS 5.3.0 release (such as the ones listed above) will be automatically fetched from Nexus. Therefore, you can simply clone this repository tag to your computer and build it to get a standard product pack. See the topic on Using Maven to build Git repositories.

    Git Repository NameRepository URLTag for AS 5.3.0 Release
    product-ashttps://github.com/wso2/product-as.gitv5.3.0

Cloning a Git repository

Given below are the steps that you need to follow in order to clone a Git repository to your computer.

  1. Clone the repository, so that the files that are in the WSO2 Git repository are available on your computer:

    git clone <DEPENDENT_REPOSITORY_URL> <LOCAL_FOLDER_PATH> 

    For example, clone the carbon-commons repository, which is in the WSO2 Git repository, to a folder named CC_SOURCE_HOME on your computer:
    git clone https://github.com/wso2/carbon-commons.git /Users/testuser/Documents/CC_SOURCE_HOME 

  2. Navigate to the folder in your computer to which the code base is cloned:
    cd <DEPENDENT_REPOSITORY_FOLDER_PATH>

    Example:
    cd /Users/testuser/Documents/CC_SOURCE_HOME

  3. Clone the dependent repository tag that corresponds to the version of the code base:  
    git checkout -b <REMOTE_BRANCH/TAG> <LOCAL_BRANCH>

    Note

    The local branch name should be identical to the remote branch name.

    For example, if you want to download the carbon-commons repository tag that was used for the WSO2 AS 5.3.0 release, you need to clone the v4.4.7 tag:

    git checkout -b v4.4.7 v4.4.7

Building a WSO2 product from source

...

Info

Prerequisites for using Maven:

  • Install Maven and JDK. See Installation Prerequisites for See the Installation Prerequisites page for compatible versions. 
  • Set the environment

    variable 

    variable to avoid the Maven OutOfMemoryError as follows:

    JDK VersionEnvironment Variable Setting
    JDK 7MAVEN_OPTS="-Xms1024m -
    Xmx2048M
    Xmx2048m -XX:MaxPermSize=1024m
    " to avoid the Maven OutOfMemoryError.
    "
    JDK 8MAVEN_OPTS="-Xms1024m -Xmx2048m"

Use one of the following Maven commands to build your repositories:

...