Sunday, June 28, 2015

Add third party library to custom feature developed for WSO2 product.

This is a great article which explain how to write a custom feature for WSO2 product.(

This blog post is going to explain how to add third party library to your custom feature.

1. You can create orbit bundle from that third part library.

Eg : This[i] is to make the Apache POI library as OSGI bundle.


2. Build your orbit bundle. (use maven)

3. Then you need to add that dependency to student-manager/features/org.wso2.carbon.student.mgt.server.feature/pom.xml file.


4. Add new <bundleDef> entry inside the <bundles> element in student-manager/features/org.wso2.carbon.student.mgt.server.feature/pom.xml file.

The format of the <bundleDef> should be , <bundleDef>[groupId]:[artifactId]</bundleDef>


org.apache.poi.wso2 - groupId of above dependency
poi                           - artifactId of above dependency

5. Build the student-manager project again, now you should see that poi_3.9.0.wso2v1.jar file in student-manager/repository/target/p2-repo/plugins directory.

6. Finally when you install student-manager feature to WSO2 server (from that p2-repo), that third party library(poi_3.9.0.wso2v1.jar) will automatically install.