Getting started with OpenVPMS


The purpose of this document is to outline the requirements for getting the OpenVPMS webapp up and running from the source.


(Your mileage may vary with different database versions)

Setting up MySQL

MySQL Server

When configuring the MySQL server:

  • the InnoDB storage engine should be used.
  • UTF8 should be the default character set.

These have the corresponding settings my.ini:


Creating the database

Create a database named openvpms, with a single user openvpms:

mysql -u root -p
mysql> create database openvpms;
mysql> grant all on openvpms.* to openvpms identified by 'openvpms';

As of openvpms 1.8, an openvpms-1_8 database is also required:

mysql -u root -p
mysql> create database `openvpms-1_8`;
mysql> grant all on `openvpms-1_8`.* to openvpms identified by 'openvpms';

Getting the Source

To get the most recent sources from SVN:

svn co svn:// openvpms

Building the Sources

The easiest way to build the sources is to simply run:

> cd openvpms
> mvn -DskipTests install

WARNING - This will drop and recreate any existing tables

Running the webapp from maven

To run the webapp from maven:

1. Create the database schema, load archetypes, and sample data

> cd openvpms-archetypes
> mvn hibernate3:hbm2ddl openvpms-archetype:load openvpms-data:load

2. Load SMS archetypes

> cd ../openvpms-sms
> mvn openvpms-archetype:load

3. Load report templates

> cd ../openvpms-release
> mvn openvpms-report:load

4. Start tomcat

> cd ../openvpms-web/openvpms-web-app/
> mvn -DskipTests tomcat7:run

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

Login user name is admin password is admin



SQL Logging

To log SQL queries, p6spy can be enabled as follows:

> mvn tomcat7:run -Drelease.jdbc.driverClassName=com.p6spy.engine.spy.P6SpyDriver

This will log to a file named spy.log in the current directory.

In OpenVPMS 1.9, p6spy 2.1.4 is used. This is configured differently to the 1.3 version used previously. The equivalent is:

> mvn tomcat7:run -Drelease.jdbc.url=jdbc:p6spy:mysql://localhost:3306/openvpms-1_9 -Drelease.jdbc.driverClassName=com.p6spy.engine.spy.P6SpyDriver

Note that there may be a simpler way. Documentation is here.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

 When I tried the steps to build the individual projects it failed, because openvpms-report-maven-plugin (in maven-plugins) depends on openvpms-reports, which depends on openvpms-archetypes. Also, openvpms-archetypes depends on maven-plugins, which is circular. Therefore, the correct order should be:

> cd openvpms-framework
> mvn -Dmaven.test.skip install
> cd ../maven-plugins
> mvn -Dmaven.test.skip install
> cd ../openvpms-archetypes
> mvn -Dmaven.test.skip install
> cd ../openvpms-reports
> mvn -Dmaven.test.skip install
> cd ../maven-plugins
> mvn -Dmaven.test.skip install
> cd ../openvpms-web
> mvn -Dmaven.test.skip install


Syndicate content