Working on OpenESB core and components with Netbeans
Introduction
Often, when meeting OpenESB advanced users, people complain about OpenESB component build complexity. It stops them to fix and improve components and, as such, they cannot provide the community with new features and improvement. Indeed, for historical reasons, due to the hasty end of Sun Microsystems support, OpenESB code and the builds were not very easy to comprehend, understand, modify and build. In order to remove this impediment, we worked very hard to improve OpenESB code infrastructure.
Our first objective was to move the code from SVN to Git. Today (2013 Q1) OpenESB code is available on Bitbucket (https://bitbucket.org/openesb/) .
The second is to propose an easy way to set up a development infrastructure on your personal development machine. This paper explains how to set up a complete environment based on Netbeans to improve, debug and build OpenESB component. Some steps are required to set up tools and Netbeans configuration. Each step is easy and requires little knowledge. So, today you are able to download, debug test and build the complete OpenESB code.
There are three parts in OpenESB code: The core, the components and the Netbeans plugins. In this paper, we explain how to build the core and the component. Another document about the plugin will be issued soon.
This document is dedicated to advanced Java developers and do not target OpenESB users.
We hope this simple guide will make easier OpenESB access code and promote community involvement in OpenESB Evolution.
At the first glance
The picture below describes the main steps to setup a build environment.
The best way to success is to complete successfully each step at a time.
Software installation
To setup your OpenESB component development context, you must install on your machine the following applications.
Application | Version | Comment |
JDK | Version 1.6 or > | OpenESB new version compile easily with JDK starting from 1.6. However, if you want to compile using JDK 6, you have to set your endorsed libraries with JAXWS-API and JAXB-API using version 2.2. Download JAXB-API 2.2.4 and JAXWS-API 2.2.5 and save to $JAVA_HOME/jre/lib/endorsed/
|
Maven | 2.2.1 | Use Version 2.2.1 |
OpenESB Version | >= 2.3 | OpenESB for Glassfish 2 server |
Install and set up JDK
Install JDK 1.6 or newer to build OpenESB components. We double checked the process provided in this document with the JDK 1.7_9 64 bits. Don't forget to set your JAVA_HOME environment variable accurately. However, to compile correctly OpenESB project, you MUST set up "Source and Binaries" with 1.6. See more details below.
Install and set up Maven
Use Maven version 2.2.1 (A migration to maven 3 is planed). When maven installation is finished, change your Maven settings.xml and add the following options:
In setting.xml, <profiles> section add OpenESB profile
<profile>
<id>openesb</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>openesb-snapshot</id>
<url>http://build2.open-esb.net:8081/nexus/content/repositories/openesb-snapshot/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>openesb-release</id>
<url>http://build2.open-esb.net:8081/nexus/content/repositories/openesb-release/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
</profile>
Add OpenESB as <active profile>
<activeProfiles>
<activeProfile>openesb</activeProfile>
</activeProfiles>
Save settings.xml
Install and set up OpenESB
Install OpenESB V2.3 or above with Glassfish application server. Running OpenESB with JDK 1.7 or 1.8 is not an issue since we can set Netbeans to use JDK 1.6 for building task.
Setting OpenESB
Open Netbeans. From the main menu, select Tools > Option > Java > Maven
Change Maven Home and select the directory where Maven 2.2.1 is installed.
Netbeans settings is done.
Download OpenESB component source code
The best practice is you to create your own git repository and fork the component code then download the code from you own repository. Then you will be able create pull request to the community repository. In the document we download the code directly from OpenESB repository.
From Netbeans main menu select Team->Git->Clone
Repository URL for OpenESB component is : https://bitbucket.org/openesb/openesb-components.git . Enter your login/password if required and click Next.
Select the master branch. Click Next.
Fill the Parent Directory. Let the clone name unchanged.
Click on finish. Netbeans starts cloning OpenESB components project on your machine. On my machine it takes around 30 minutes. Be patient. (Moreover, Netbeans does not log what it does when cloning).
Set up the main project
OpenESB components top project is named for historical reasons alaska-top. Before proper building it; you have to set it up first. Open it without opening the required projects.
On alaska-top click right, choose properties and select Sources.
Set Sources/Binary Format at 1.6.
On alaska-top click right,choose properties and select "Actions".
Select "Clean project" action and add the following properties: