Tuesday, June 22, 2010

Build WSO2 ESB from source

This post will discuss how to build WSO2 ESB[1] from the WSO2 Carbon[2] trunk.

1) Checkout WSO2 Carbon project's trunk.

heshan@heshan-laptop:~/Dev/trunk/$ svn co https://svn.wso2.org/repos/wso2/trunk/carbon

Following directories/files would be checked-out to your file system.

carbon
|-- components
|-- core
|-- dependencies
|-- features
|-- orbit
|-- pom.xml
|-- products

2) Build the dependencies for ESB project.

heshan@heshan-laptop:~/Dev/trunk/carbon/dependencies$ mvn clean install -Dproduct=esb

Then the following dependencies will be built. If you encounter any build errors, try and build each project one at a time :)

dependencies
|-- abdera
|-- axiom
|-- axis2
|-- wss4j
|-- carbon-p2-plugin
|-- commons/caching
|-- commons/eventing
|-- commons/throttle
|-- commons/xkms
|-- p2
|-- rampart
|-- rhino
|-- sandesha
|-- savan
|-- synapse
|-- transports
|-- commons-vfs

Carbon Dependencies :-
Carbon platform makes use of already existing open source projects rather than trying to re-invent the wheel. We use popular and matured open source projects like apache axiom, axis2, synapse etc which fuel the very heart of the carbon platform. Dependencies contains all these open source projects that the carbon platform makes use of adding more value to them.

3) Build Carbon Orbit for ESB project.

heshan@heshan-laptop:~/Dev/trunk/carbon/orbit$ mvn clean install -Dproduct=esb
Carbon Orbit :-
WSO2 Carbon uses OSGi as its underlying modularization technology. But Many 3rd party open source libraries does not exists in osgi form (ie. in osgi bundle form). Therefore to introduce them to the carbon platform, we wrap-around them to make them proper OSGI bundles (They will be useful to any OSGI environment like felix, knoplerfish etc). Carbon-orbit project contains all these third party bundles.

4) Build Carbon Core for ESB project.

heshan@heshan-laptop:~/Dev/trunk/carbon/core$ mvn clean install -Dproduct=esb
Carbon Core :-
This is where we create the base for our platform. Everything runs on top of this base. From the simple OSGi framework to the UI framework, all the critical technologies for the platform are implemented here.

5) Build Carbon Components for ESB project.

heshan@heshan-laptop:~/Dev/trunk/carbon/components$ mvn clean install -Dproduct=esb
Carbon Components :-
Components module contains the main functionalities that are introduced by each and every product in addition to to the core level features. Among the close to 100 components each adds value to the product in a different way than the next. Some will enhance the security while some may just provide vital tools to monitor the health of the system.

6) Build Carbon Features for ESB project.

heshan@heshan-laptop:~/Dev/trunk/carbon/features$ mvn clean install -Dproduct=esb
Carbon Features :-
Equinox P2 has been integrated with WSO2 Carbon platform to enable provisioning capabilities. This enables you to extend or enhance your carbon platform with more functionalities or just strip out the irrelevant features which suits your context.

7) Build WSO2 ESB product.

heshan@heshan-laptop:~/Dev/trunk/carbon/products/esb$ mvn clean install
Carbon Product :-
Products module contains all the products ranging from ESB to BRS.

8) When the build is successful move to target folder inside esb project.

heshan@heshan-laptop:~/Dev/trunk/carbon/products/esb/modules/distribution/target$ ls
pom-transformed.xml wso2esb-3.0.0-SNAPSHOT wso2esb-3.0.0-SNAPSHOT-docs.zip wso2esb-3.0.0-SNAPSHOT.zip

Then unzip the SNAPSHOT.

heshan@heshan-laptop:~/Dev/trunk/carbon/products/esb/modules/distribution/target$ unzip wso2esb-3.0.0-SNAPSHOT.zip

Start the ESB server

heshan@heshan-laptop:~/Dev/trunk/carbon/products/esb/modules/distribution/target/wso2esb-3.0.0-SNAPSHOT/bin$ ./wso2server.sh

Now you have successfully built and started a WSO2 ESB build from Carbon trunk.

References
[1] - http://wso2.com/products/enterprise-service-bus/
[2] - http://wso2.com/products/carbon/

NOTE: If you need to build any other Carbon based product, repeat the above steps by replacing the product name to the relevant product.

mvn version used for testing this was:

heshan@heshan-laptop:~$ mvn -version
Apache Maven 2.1.0 (r755702; 2009-03-19 00:40:27+0530)
Java version: 1.6.0_03
Java home: /home/heshan/Installations/jdk1.6.0_03/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" arch: "i386" Family: "unix"


6 comments:

Charith said...

great post. it was useful. btw i think the above comment should be moderated..

Heshan Suriyaarachchi said...

Thanks Charith :).

I removed the spam comment. I think it was added by someone before I added comment moderation.

Anwarul said...

nice post..can it be installed in windows based?

Heshan Suriyaarachchi said...

Thanks.
Yes, same blogpost can be followed to build WSO2 ESB from source on a Windows OS.

Susara De Saram said...

nice post. thank you very much for sharing this. when we build the dependencies one by one, there are multiple versions of each project. is there any issue of selecting the version? or is it okay to build the latest in each?
I'm trying to build ESBv4.0.3 on windows 7 and I get a PermGen Space error. so I'm thinking to build them one by one.
thank you..

Heshan Suriyaarachchi said...

Hi Susara,

Thanks. I wrote this post sometime back and I have not been in touch with build of WSO2 ESB recently. Can you ask your questions in the WSO2 Carbon Developer mailing list.