Building from Source
WSO2 invites you to contribute by checking out the source of WSO2 Private PaaS from the GitHub, building the product and making changes. You can contribute back by sending a pull a request for review. For information on using Git version control system, go to the Git documentation.
Building from source is optional. Users who do not want to make changes to the source code can simply download the binary distribution of the product and install it.
Downloading the source
Clone WSO2 Private PaaS Git repository to a folder of your choice. The location of the extracted source is referred to asÂ
<PRIVATE_PAAS_HOME>
.
git clone https://github.com/wso2/private-paas.git <local-folder-name>
For example:Â
git clonehttps://github.com/wso2/private-paas.git
PRIVATE_PAAS_HOME
 Make sure that you have setup Git properly. For more information, go to Getting Started with Git.
Navigate to the
<PRIVATE_PAAS_HOME>
 directory.
cd PRIVATE_PAAS_HOME
- Checkout WSO2 Private PaaS 4.0.0 tag to a folder of your choice:
git checkout -b <REMOTE_BRANCH/TAG> <LOCAL_BRANCH>
For example:
git checkout -b 4.0.0 4.0.0
Editing the source code
Now that you have downloaded the source code for the Carbon project from GitHub, you can prepare your development environment and do the required changes to the code.Â
To edit the source code in your IDE, set up your development environment by running one of the following commands:
IDE Command Additional information Eclipse mvn eclipse:eclipse
http://maven.apache.org/plugins/maven-eclipse-plugin IntelliJ IDEA mvn idea:idea
http://maven.apache.org/plugins/maven-idea-plugin If you are using a later Eclipse version and if you get errors (library path etc.) when trying to import the source code using the Existing Projects into Workspace option, you can solve them by importing the source code as a Maven project. To do this; open Eclipse and click Import in the File menu and then click Existing Maven Projects as shown below:Â
- Add the required changes to the source code.
Building the source and copying the Apache Stratos distributions
Prerequisites
- Install Maven and JDK. See Installation Prerequisites for compatible versions.Â
- Set the environment variableÂ
MAVEN_OPTS="-Xms768m -Xmx3072m -XX:MaxPermSize=1200m"
 to avoid the mavenÂOutOfMemoryError.
- Make sure the build server has an active Internet connection to download dependencies while building.
The following are two methods in which you can build the source and copy the Apache Stratos Cartridge Agent, Apache Stratos Load Balancer and Apache Stratos distribution files. Use either one of the following methods to carry out this task:
Method 1 - Building the source and manually copy the Apache Stratos distributions
Run theÂ
build.sh
 script that is located in theÂ<PRIVATE_PAAS_HOME>/
source
 directory to build the source.
./build.sh -b
Manually copy the Apache Stratos Cartridge Agent, Apache Stratos Load Balancer and Apache Stratos distributions to the
Â
<PRIVATE_PAAS_HOME>/packs
 directory. The latter mentioned Apache Stratos distributions can be found in the following directories:Product Location Apache Stratos Cartridge Agent <PRIVATE_PAAS_HOME>/source/products/cartridge-agent/modules/distribution/target/apache-stratos-cartridge-agent-4.0.0-bin.zip
Apache Stratos Load Balancer <PRIVATE_PAAS_HOME>/source/products/load-balancer/modules/distribution/target/apache-stratos-load-balancer-4.0.0.zip
Apache Stratos <PRIVATE_PAAS_HOME>/source/products/stratos/modules/distribution/target/apache-stratos-4.0.0.zip
Method 2 -Â Simultaneously building the source and copying the required product distributions
Run the following command to simultaneously build the source and copy the required product distributions (namely Apache Stratos Cartridge Agent, Apache Stratos Load Balancer and Apache Stratos distributions) to the <PRIVATE_PAAS_HOME>/packs
 directory:Â
. /build.sh -c
Â
Committing your changes
You can contribute to WSO2 products by committing your changes to GitHub. Whether you are a committer or a non-committer, you can contribute with your code as explained in the Get Involved section.