Wiki Spaces
Documentation
Projects
Resources
Get Help from Others
Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack
This guide is for anyone who wants to setup their development environment to start working with OpenMRS.
Make sure you have the following installed on your laptop before you get started.
If you want to install openmrs the traditional way you can follow the link here. But we recommend using the OpenMRS SDK for the hackathon because it makes installing easier. Make sure you do this before the hackathon because it takes around half an hour on a good internet connection to download all the dependencies.
mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk
mvn openmrs-sdk:help
You can either install MYSQL locally on your machine or if you have docker installed you can use the command below to start a MYSQL server in a docker container. If you choose to start your mysql inside docker your jdbc url connection string would be based on the ip address of the docker daemon. By default it is 192.168.99.100.
docker run --name openmrs-mysql -e MYSQL_ROOT_PASSWORD=openmrs -d -p 3306:3306 mysql:5.6
#Make sure you substitute your mysql root password into the command before you run it. mvn openmrs-sdk:setup -DserverId=openmrs -Dversion=2.3 -DdbDriver=mysql -DdbUser=root -DdbPassword=openmrs -DdbUri="jdbc:mysql://192.168.99.100:3306/openmrs?autoReconnect=true&sessionVariables=storage_engine=InnoDB&useUnicode=true&characterEncoding=UTF-8"
serverId is the server name under which the server would be installed.
#Make sure you substitute your mysql root password into the command before you run it. mvn openmrs-sdk:setup -DserverId=openmrs -Dversion=2.3 -DdbDriver=mysql -DdbUri="jdbc:mysql://localhost:3306/openmrs?autoReconnect=true&sessionVariables=storage_engine=InnoDB&useUnicode=true&characterEncoding=UTF-8" -DdbUser=root -DdbPassword=<YOUR_ROOT_PASSWORD>
OpenMRS would be installed in the folder ~/openmrs/<serverId>
mvn openmrs-sdk:run -DserverId=openmrs
TroubleShooting tip
When you run the openmrs-sdk:run for the first time you may get the following error which can be ignored for the time being as this does not effect with the functioning of the application.
Caused by: java.sql.SQLException: Access denied for user 'test'@'localhost' (using password: YES)
Check out the the openmrs application at http://localhost:8080/openmrs
When you start openmrs for the first time it would go through initial setup. Complete the initial setup it may take a few minutes.
Congrats you are done with the installation. The username and password to login to OpenMRS would be admin/Admin123. You should be able to see the OpenMRS home page which would look like the following.
Find a story/ticket to work on here. Pair with someone if possible.
Find out which modules needs to be modified for your story. Go into github and fork those modules.
You can learn about process of code reviewing, merging etc here.
Download the OpenMRS modules
Download the required openmrs modules from your fork of the code in github. Do not clone the OpenMRS repos as you would not be able to directly commit to it. You would need different modules depending on which story you are working on.
git clone https://github.com/openmrs/openmrs-core.git git clone https://github.com/openmrs/openmrs-module-legacyui.git
During module development, we need to test how out module works. For that each time we need to install a module on server, and them run. SDK allows to do it much more simple. You can execute run task directly from module folder, and selected module will be installed on server before launching automatically.
cd <modulename> mvn clean install mvn openmrs-sdk:run -DserverId=openmrs
OpenMRS SDK has much more features that what is listed here. Refer to the guide OpenMRS SDK
Forgot your mac MYSQL root password - Follow the instructions in the link here to reset it.
If you set the MAVEN_OPTS as the following before you start your server, you can attach a debugger to it.
export MAVEN_OPTS="-Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
mvn openmrs-sdk:run -DserverId=test