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
Java 8 - Click to download
Maven - Click to download
MySQL - Click to download
Developing with the Reference Application
The steps are as follows.
Create a distribution server.
Select Reference Application version.
Connect with the database.
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.