WSO2 API Manager is a unique product in the sense that there is an open source version. You can use it and look into the source without any cost. There’s also version with product support that will ensure that you always have the latest and greatest version with regards to security and product patches. For most organizations, the product support version is preferable. In this blog, we will take a look on how to download the source code and build the source code yourself as well as identifying the download location for the open source version of the WSO2 API Manager.
This blog is based on WSO2 API Manager 3.1 but will work similarly for WSO2 API Manager 3.2.
It all starts when you look at the GitHub repository for the API Manager. GitHub is the place where WSO2 keeps the source code of the products and versions. The URL is simple: https://github.com/wso2
When we go to https://github.com/wso2/product-apim/issues and scroll down to the bottom of that page, you will find the assets and a compiled version of the WSO2 API Manager 3.1 as well as the source code. Let’s download both and see what the differences are.
Of course, there’s the difference in size, 420 megabytes versus 83.3 megabytes. This is due to the difference in source code and compiled code. Let’s unzip the product WSO2 API Manager to the desktop and see if we can compile the version ourselves.
When you open up the directory of the unzipped source code, you’ll find a so-called POM file. In this file, you find the product build information to create your own compiled API Manager. This POM file is used to build the product in the correct way, for instance the required modules, repositories and dependencies. In order to build it, you need a tool like Maven. In theory, other build tools are also possible but that require rework of the POM file.
Building the product
The build command is pretty simple:
mvn clean install -Dmaven.test.skip=true
It will take a small amount of time. It needs to download all of the dependencies to do the build and then do the build itself. It will take about 25 minutes to complete the build.
The zip file can be found at /opt/wso2/Desktop/product-apim-3.1.0/modules/distribution/product/target
The file size is comparable as far as size goes. But what are the differences?
I am going to use Meld on Linux to compare the directories.
The difference is the timestamp in the file itself.
And there are files that have a timestamp in the filename.
So, it looks like the two are quite similar, apart from the aforementioned examples.
Let us try the newly compiled version. We will start the WSO2 API Manager using the wso2server.sh script and deploy the default sample API. This is not an ultimate test of course; you would typically use a test plan to test a new version (either downloaded or self-compiled). For now, we skip all steps to deploy the sample API and
And it works. Again, this is not a conclusive test, but it is a quick show of success.