From Foss2Serve
Revision as of 10:59, 28 January 2017 by Clif.kussmaul (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Howard Francis, based on group work started at the September 2015 POSSE, describes a virtual machine that has the OpenMRS-core as downloaded from the OpenMRS github repo. He then installed Eclipse on the VM so that he and his students could develop for the OpenMRS-core directly within the VM. Howard's VM is described at OpenMRS-Dev.

I took a slightly different approach with the VM I describe below. I also started with the VM developed at POSSE 2015. However, feeling that development within the OpenMRS core was too complicated, I instead had my students work on developing an OpenMRS module as described at the OpenMRS Developer Guide and the help page entitled "Using the maven archtype wizard". Taking this route meant that my students did not have to do their development in the VM. Instead they only had to run the VM as an OpenMRS-core JSP server with a MySQL DB on the backend. They could do their development by compiling the module they were working on using their own workstation, which was also serving as the host machine for the VM running the OpenMRS server. Consequently they could use whatever IDE they felt most comfortable with in developing that module. Once the module was built on the host machine, the resulting OMOD file could be transferred to the ~/.OpenMRS directory on the VM using SFTP as described in the CS50 appliance manual. Putting a compiled and packed OMOD file into this directory in effect installs the module on the server.

To see how this works, download my virtual machine from [1] (about 2.5 GB). Unzipping that file will result in an OVF that can be imported into VMWare or VirtualBox. Import and start the virtual machine. Then open a terminal and start the OpenMRS JSP server by typing:

 $ cd openmrs-code/webapp
 $ mvn jetty:run

On the VM, I've put a working version of the "Add-a-department" module described under Customize Your Module in the OpenMRS Developer Guide. You'll find the source code for this module in a directory ~/OpenMRS-module-development/Department/department on the VM. If you copy this directory to your host machine, this will be the source code that your students can compile and build to get the OMOD module file. To build the module, just type

 $ mvn clean install -Dmaven.test.skip=true

in this directory (or use your IDE to build the module if it has a maven plug-in installed). You will find the resulting OMOD file in the file omod/target/department-1.0-SNAPSHOT.omod. This is file that you can transfer to the ~/.OpenMRS directory on the VM to install the module on the server. Re-start the server or use the "Manage Modules" option from an Administrator login within the running server to have the newly installed module recognized.

Any questions can be directed to me -- Tom Naps at

Personal tools
Learning Resources
HFOSS Projects