OpenMRS server setup using SDK

Why use the SDK?

The SDK is the tool for setting multiple self-contained servers that can be run independently, at the same time by running each available server on a different port.

The SDK creates an independent Tomcat instance with its own database.

Prerequisite

  1. Java 8 - Click to download

  2. Maven - Click to download

  3. MySQL - Click to download

Developing with the Reference Application

The steps are as follows.

  1. Create a distribution server.

  2. Select Reference Application version.

  3. Connect with the database.

  4. Running the server.

 

Step 1. Create a server by running:

mvn openmrs-sdk:setup

This will start the SDK in the wizard mode.

 

Specify server id (-DserverId) (default: 'server'):

When prompted, give a name to the server you're creating otherwise by default it assigns 'server'

Next, you will be prompted to select the server type.

You can setup the following servers: 1) Distribution 2) Platform Which one do you choose? [1/2]:

Make a Distribution server by entering 1.

 

Step 2. Next, you'll be prompted to select the distribution version.

 

Step 3. Next, You will be asked what database you want to use:

Answer 1 here. The last prompt will ask you for the path to JDK:

If you have properly configured JAVA_HOME, answer '1'. If not, you need to answer with '4' and type path to JDK on your machine. Please note that OpenMRS platform 2.x requires JDK 8 to run.

 

Step 4. To run the server.

This will start the server locally.