Versions Compared

Key

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

The source code of all WSO2 products Application Server as well as the scripts that are used for building all other WSO2 products are maintained in GitHub repositories. If  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.

See the following topics for instructions on how to work with WSO2 Git repositories:

Table of Contents
maxLevel3
minLevel3

Identifying WSO2 Git Repositories

In GitHub, the WSO2 source code is organized into separate repositories and each WSO2 product is built using several of these repositories. Therefore, if you are interested in editing the source code and building a customized product, you need to first identify the Git repositories that you require.

Info

For the complete list of repositories used by WSO2 products, see this link.

The Git repositories used by WSO2 products are of two categories: 

...

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

...

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.

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

...

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

As explained above in the section on identifying WSO2 Git repositories, you can easily build a product pack by building the product-level Git repository on your computer. However, if you have modified any of the component-level repositories that are used for this product, you need to first build those component repositories before building the product repository. Given below are the steps you need to follow.

Info

Use Maven to build your repositories. See the next topic for instructions on how to use Maven for building repositories.

  1. Build all the component-level repositories that you have cloned to your computer and edited. Be sure that you build the repositories in the correct order. Email dev@wso2.org to get help.

  2. Once you have built the component-level repositories, build the product-level repository that you have cloned to your computer.

    When you build the product repository, Maven will first check in the local Maven repository on your computer and fetch the repositories that you built in Step 1. Maven will then fetch the remaining dependent repositories from Nexus. This process will give you a new product pack with your changes. 

    You can find the new binary pack (ZIP file), in the <PRODUCT_REPOSITORY_HOME>/modules/distribution/target directory.

Using Maven to build Git repositories

You can use Maven to build the Git repositories that you clone to your computer. 

Info

Prerequisites for using Maven:

  • Install Maven and JDK. See Installation Prerequisites for compatible versions. 
  • Set the environment variable MAVEN_OPTS="-Xmx2048M -XX:MaxPermSize=1024m" to avoid the Maven OutOfMemoryError.

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

CommandDescription
mvn clean install

The binary and source distributions.

mvn clean install -Dmaven.test.skip=true The binary and source distributions, without running any of the unit tests.
mvn clean install -Dmaven.test.skip=true -o
The binary and source distributions, without running any of the unit tests, in offline mode. This can be done only if you have already built the source at least once.

 WSO2 invites interested parties to contribute their changes and suggestions to WSO2. 

See the documentation on working with the source code for more information.