This tutorial will introduce you to OpenMRS SDK (Software Development Kit). It assumes that you have basic understanding of OpenMRS modular architecture (you can learn about it by reading Technical Overview).
- Create server
- Add developed project to watched projects on server
- Create debugging configuration in IDE
- Run server
We will walk through these steps and create environment to develop and debug REST module on top of OpenMRS 2.0.0 platform.
Which database would you like to use?:
2) MySQL 5.6 7 (requires pre-installed MySQL 5.67)
3) MySQL 5.6 7 in SDK docker container (requires pre-installed Docker)
4) Existing docker container (requires pre-installed Docker)
mvn openmrs-sdk:run -DserverId=webservices.-dev -Dfork=false
Steps to create debugging configuration depend on IDE you are using, but it should be quite easy to find.
This way you can set up development environment for any module and openmrs-core. Remember that you have to provide all required modules by currently developed module.
Developing with the Reference Application
You can easily develop/ debug modules with the Reference Application just like with the platform. The steps are as follows.
- Create a distribution server.
- Select Reference Application version.
- Set debug port.
- Connect with database.
- Add a module as watched in the selected server.
As before, create a server by running
This will start the SDK in the wizard mode. When prompted, give a name to the server you're creating.
Next, you will be prompted to select 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. Next you'll be prompted to select the distribution version.
You can deploy the following versions of distribution: 1) Reference Application 2.6-SNAPSHOT 2) Reference Application 2.5 3) Reference Application 2.4 4) Reference Application 2.3.1 5) Reference Application 2.2 6) Other... Which one do you choose? [1/2/3/4/5/6]:
Select the latest Reference Application version by entering 1. The rest of the steps are the same as explained under Setting up dev environment. The watched modules will be built from source and deployed to the selected server every time you run that server.
Creating new distribution