How to contribute to WSO2 API Manager?

Tharika Madurapperuma
5 min readJan 28, 2021
Photo by Domenico Loia on Unsplash

WSO2 API Manager is an Open Source Platform which anyone can contribute to. All community contributions are welcome.

WSO2 Developers carry out active development in the following repositories for WSO2 API Manager.

  1. carbon-apimgt (branch — master) (Contains the backend code)
  2. apim-apps (branch — main) (Contains the UI code)
  3. product-apim (branch — master) (Contains the code required to build the product pack)

Pre-requisites

  • Java 11.
  • NodeJS 16.x.
  • Maven 3.x or higher.
  • Minimum memory 2GB.

How to quickly build a latest WSO2 API Manager pack (distribution) and start the server locally?

mvn clean install -Dmaven.test.skip=true
  • Obtain the WSO2 API Manager pack from <product-apim>/modules/distribution/product/target directory and extract it to your desired location.

Example package name : wso2am-4.2.0-SNAPSHOT.zip

  • Start the WSO2 API Manager server by moving into <APIM_HOME>/bin folder where APIM_HOME is the folder you obtain by extracting the above zip and then execute the following command .

If your machine is Linux or Mac,

./api-manager.sh

If your machine is Windows, execute the api-manager.bat file.

If you see a part of a log similar to the following in the Terminal / Command-line without any exceptions, you can safely assume that the server has successfully started.

INFO — CarbonUIServiceComponent Mgt Console URL : https://localhost:9443/carbon/
INFO — CarbonUIServiceComponent API Developer Portal Default Context : https://localhost:9443/devportal
INFO — CarbonUIServiceComponent API Publisher Default Context : https://localhost:9443/publisher

What Portals can be accessed after server startup?

The functions defined in this document will be performed by the Publisher Portal while those defined in this document are performed by the Developer Portal. The Admin Portal and the Management Console are used for performing all the Administration related functions.

How to do changes locally to the repository and build the latest pack?

Note: Checkout both carbon-apimgt and product-apim to the same folder location.

After making your changes to the code in carbon-apimgt, if you want to quickly make a complete pack with your changes included, follow the steps below.

  • Navigate to carbon-apimgt folder and run the following command skipping the tests.
mvn clean install -Dmaven.test.skip=true
  • After the build is successful, navigate to product-apim folder and open the /product-apim/pom.xml file. Then change the following entry with the value found in <version>…</version> element in the /carbon-apimgt/pom.xml file. For example with 9.28.208-SNAPSHOT.
<!-- APIM Component Version -->
<carbon.apimgt.version>9.28.208-SNAPSHOT</carbon.apimgt.version>
  • Now run the following command without tests from within the product-apim folder.
mvn clean install -Dmaven.test.skip=true
  • Now you can obtain the WSO2 API Manager pack from <product-apim>/modules/distribution/product/target directory and extract it to your desired location.

Example package name : wso2am-4.2.0-SNAPSHOT.zip

  • Extract and start the server and see whether your changes have been applied successfully.

Building the pack after doing UI changes

In order to get the latest pack with the UI changes done on the apim-apps repo, you can do the following.

mvn clean install -Dmaven.test.skip=true
  • After the build is successful, navigate to product-apim folder and open the /product-apim/pom.xml file. Then change the following entry with the value found in <version>…</version> element in the /apim-apps/pom.xml file. For example with 9.0.488-SNAPSHOT.
<!-- APIM Portals Component Version -->
<carbon.apimgt.ui.version>9.0.488-SNAPSHOT</carbon.apimgt.ui.version>
  • Now build the product-apim repo and obtain the built pack similar to how this is done for the carbon-apimgt repo.

Bonus Tip! 🙂

There is always an option to do the changes easily and check yourself without having to build the entire pack from the beginning. You can follow the steps given in the following articles to see how that can be done.

  1. How to apply Java code changes to WSO2 server on the go?
  2. How to apply changes to WSO2 API Manager React Portals on the go?

How to build the pack with tests?

This step is really important if you want to send a PR to the carbon-apimgt, apim-apps or product-apim repositories.

Before sending a PR you should build the repositories with tests as follows to make sure that your changes have not caused any issues and have broken the existing tests.

  • Navigate to carbon-apimgt folder and execute the following command. This will run the unit tests found in carbon-apimgt repository. This step would take a bit of extra time than when building the repository without tests.
mvn clean install
  • Navigate to the apim-apps repository and run the following command to build the repo. To run the tests use the steps given in the README.md file of the apim-apps repo.
mvn clean install
  • If these builds with tests are successful, navigate to product-apim folder and make sure to change the <carbon.apimgt.version> or <carbon.apimgt.ui.version> in /product-apim/pom.xml file as necessry.
  • Now execute the following command to run the product-apim repository with tests. This will run the build with integration tests. This step would take a considerable amount of time. Approximately 2 to 3 hours.
mvn clean install
  • After both the builds are successful, you can initiate your PR to the carbon-apimgt, apim-apps or product-apim repository as required.

Where to select issues to work on?

If you want to select issues to work on, pick one from the api-manager repository. If there are any doubts that you need to clarify regarding the issue you have picked, you can reply to the Git Issue and get feedback from WSO2 API Manager Team and the community.

Thank you for reading the article!

If you find any outdated content or issues with this article, please feel free to create an issue at Developer Corner Git repository here. Let’s grow together and help others in their journey too!

If you like this article please give it a clap. 🙂

Cheers!

--

--