Building OpenVPMS with Eclipse

NOTE: these instructions don't work under Eclipse Luna and need to be revisited.

 

These instructions describe how to build OpenVPMS with Eclipse using the m2eclipse plugin.

Installing the m2eclipse plugin

Instructions for installing m2eclipse can be found here: www.sonatype.com/books/m2eclipse-book/reference/installing.html
   
Under "Installing Prerequisites",  only "Subclipse" is need to check out and build OpenVPMS.
Use the Subclipse 1.6 update site: http://subclipse.tigris.org/update_1.6.x instead of the 1.2.x site listed.

Using the new eclipse software update you will need to add the following update sites in Eclipse.

Subclipse 1.8.x Update Site    http://subclipse.tigris.org/update_1.8.x

Maven Integration for Eclipse Update Site    http://download.eclipse.org/technology/m2e/releases/

Subclipse m2E    http://subclipse.tigris.org/m2eclipse/1.0/

m2eclipse's latest version is not compatible with Subclipse 1.8, so you can either downgrade or use subclipse's own patch to m2e available in the 3rd update site.

Getting the source

OpenVPMS is broken up into several projects and stored in the subversion version control system.

These can be checked out as follows:

1. Select File -> New Project

2. In the Select a wizard dialog, select Maven -> Checkout Maven Projects from SCM.
3. In the Checkout as Maven project from SCM dialog, select svn in the combo box, and enter the SCM URL:

svn://svn.openvpms.org/openvpms/projects/openvpms/trunk

 

4. Click Finish

 

After checking out the projects, the openvpms-framework, openvpms-reports and openvpms-etl modules need to be updated so that Eclipse can find the sources generated by the castor plugin.

To do this, in Project Explorer, right click on each and select Maven -> Update Project Configuration

 Creating the database schema

This can be done using the hibernate3:hbm2ddl maven goal.

1. Select Run -> Run Configurations -> Maven Build

2. Click New

3. Rename the new configuration to Create Schema

4. For Base directory:, select Browse Workspace... -> openvpms-archetypes

5. For Goals:, enter hibernate3:hbm2ddl

6. Click Run

Loading Archetypes

This is done using the openvpms-archetype:load maven goal.

1. Select Run -> Run Configurations -> Maven Build

2. Click New

3. Rename the new configuration to Load Archetypes

4. For Base directory:, select Browse Workspace... -> openvpms-archetypes

5. For Goals:, enter openvpms-archetype:load

6. Click Run

7. You also load the sms archetypes so make sure you repeat the above but adjust for the openvpms-sms workspace.

Loading Sample Data

This is done using the openvpms-archetype:load maven goal.

1. Select Run -> Run Configurations -> Maven Build

2. Click New

3. Rename the new configuration to Load Sample Data

4. For Base directory:, select Browse Workspace... -> openvpms-archetypes

5. For Goals:, enter openvpms-data:load

6. Click Run

 

Running the Web Application

The simplest way to deploy the web application is via the embedded Tomcat plugin.

1. Select Run -> Run Configurations -> Maven Build

2. Click New

3. Rename the new configuration to Tomcat

4. For Base directory:, select Browse Workspace... -> openvpms-web/openvpms-web-ap

5. For Goals:, enter tomcat7:run

6. Click Run

 

The app can be accessed at http://localhost:8080/openvpms/app

Login user name is admin password is admin

Syndicate content