How to Set up WSO2 WSAS in Eclipse using Maven2?

Archived Content
This article is provided for historical perspective only, and may not reflect current conditions. Please refer to relevant product page for more up-to-date product information and resources.
  • By Lahiru Sandakith Gallege
  • 11 Oct, 2007

So the first step will be to set up the project in his favorite IDE ( Integrated Development Environment) such as Eclipse. Richard is so Open Source friendly that he will love to set up all his open source projects in an open source IDE using only open source tools.

In this document the commonly asked question of how to set up WSO2 WSAS in Eclipse IDE is answered and it will help Richard to kick start his development.

 

Getting Started

The document is written using J2SDK 1.4.x, Eclipse SDK v3.3, Apache Maven v2.0.7 and any SVN client that works on user platform. The versions of the tools other than the Maven v2.0.7 are not mandatory. You can use any of the compatible versions that works with each other.

1) Java Development Kit 1.4.x (Download)

2) Eclipse SDK 3.3.x (Download)

3) Apache Maven 2.0.7 (Download)

 

Procedure

Step 1.

Get an SVN checkout of WSO2 WSAS from (https://wso2.com/repos/wso2/trunk/wsas/java) into 'wso2_wsas' directory inside your Eclipse workspace.

The user either can checkout to a location outside the workspace, or adhering to the Eclipse conventions he can checkout in to the Eclipse workspace. Ex : <eclipse_workspace>/wso2_wsas

Example command if you use command line svn client : svn co https://wso2.com/products/wsas/ <eclipse_workspace>/wso2_wsas

Step 2.

Navigate to the <eclipse_workspace>/wso2_wsas. Run the maven build on this source.

If you have correctly configured Maven on your system, running the following command will build the WSO2 WSAS source.

mvn clean install

NOTE : When building the WSO2 WSAS source through Maven v2.0.7, it will download the dependent artifacts from public Web repositories

[INFO] ----------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ----------------------------------------------------------------
[INFO] WSO2 Web Services Application Server .................. SUCCESS
[INFO] Core .................................................. SUCCESS
[INFO] Admin ................................................. SUCCESS
[INFO] Samples ............................................... SUCCESS
[INFO] Sample/Chad ........................................... SUCCESS
[INFO] Sample/CommodityQuote ................................. SUCCESS
[INFO] Sample/JavascriptService .............................. SUCCESS
[INFO] Sample/TinyURL ........................................ SUCCESS
[INFO] Sample/Trader ......................................... SUCCESS
[INFO] Sample/FlickrClient ................................... SUCCESS
[INFO] Sample/DataService .................................... SUCCESS
[INFO] Sample/NodeManagement ................................. SUCCESS
[INFO] WSO2 Web Services Application Server - Sample/MEX ..... SUCCESS
[INFO] WSO2 Web Services Application Server - Sample/XKMS .... SUCCESS
[INFO] Sample/STS ............................................ SUCCESS
[INFO] Sample/EJBService ..................................... SUCCESS
[INFO] STS ................................................... SUCCESS
[INFO] Integration ........................................... SUCCESS
[INFO] Web Resources ......................................... SUCCESS
[INFO] Clustering ............................................ SUCCESS
[INFO] Documentation ......................................... SUCCESS
[INFO] Distribution .......................................... SUCCESS
[INFO] ----------------------------------------------------------------
[INFO] ----------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ----------------------------------------------------------------

The above result will be displayed if the project build successfully

Step 3.

After successfully building the project, we have to build the Eclipse WSO2 WSAS project through maven2.

mvn eclipse:eclipse

This command will build the Eclipse project that we can import through our favorite Eclipse IDE.

Step 4.

Start Eclipse and move in to the JAVA perspective.

NOTE: If you have downloaded the Eclipse version you can extract it to any location and if the JAVA configurations are set correctly in your environment, you will be able to start it.

Step 5.

Go to File -> Import, and on the "General" tab click on the "Existing Project into Workspace".

Step 6.

Then on the Import Project Wizard you can select the root directory of the project. Browse and select the <eclipse_workspace>/wso2_wsas location. Immediately after, it will display project in the underlying projects list.

Step 7.

Accepting the default settings click Finish. Then Eclipse will automatically pick up the existing project contents (directories etc) and import it as a workable Eclipse project.

NOTE : You can notice that with the magic combination of the Apache Maven and Eclipse, all the modules will be arranged and in a particular module all the dependencies are included in to that module classpath.

Step 8.

Full build the project.

Congratulations!! Now you have successfully set up WSO2 WSAS in Eclipse IDE

If you have problems in the setup even after following the above steps, it could owe to the following reasons.
1.If Maven 2 detects and added some of the resources folders (ex : conf directory ) as source folders, you may have to remove them from the project source list. Project Properties -> Java Build Path -> Source 2.You may have not set up the code generated classes properly.
3.Compilation errors. This may be due to Maven v2.0.7 failing to import all dependent jars

For any further details and questions email to: wsas-java-user@wso2.org and if you have issues report to WSO2 WSAS JIRA

 

Applies To

WSO2 WSAS - All versions

J2SDK - v1.4 or above

Eclipse SDK - any version

Apache Maven - v2.0.7

SVN client - Any

 

Author

Lahiru Sandakith P.G. WSO2, Inc. sandakith at wso2 dot com.