- Creating Modules – https://wiki.openmrs.org/display/docs/Creating+Modules
- Creating your First Module – https://wiki.openmrs.org/display/docs/Creating+Your+First+Module
- Setup a module using the module creation command line utility
- Downloaded Spring Loaded from its maven repository http://mvnrepository.com/artifact/org.springframework/springloaded
- Downloaded and setup OpenMRS standalone from http://openmrs.org/download/ picking a version greater than 1.11.x which supports debugging options
- Once the standalone version is installed, open the openmrs-standalone-runtime.properties and add the following variables to the vm_arguments: (should all be one line – separated here for clarity)
- -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
- -Dmodule.development.directory={absolute path to root folder of the module}
- -javaagent:{absolute path to spring loaded jar}
- -noverify -Dspringloaded=inclusions=org.openmrs.module.modulepackage..* (note the two trailing dots before the *)
- Setup newly the module into an IDE (tested with IntelliJ & Eclipse)
- Installed a FileSync utility, RemoteSynchronizer for IntelliJ & FileSync (http://andrei.gmxhome.de/filesync/) for Eclipse
- Setup sync for the omod webapp folder into the standalone webapp folder located at WEB-INF/view/module/{modulename}
- Tomcat – Change the following init params in web.xml:
- modificationTestInterval from 4 to 0, so that JSPs are automatically recompiled
- development is true (this is the default)
- Intellij – the Java classes are not automatically recompiled on saving changes so there is need to run mvn package -DskipTests
- Follow the OpenMRS conventions as much as possible by cloning openmrs-core to see how the design of the interfaces, service layers is done. This will help get access to lots of the magic that happens behind the scenes.
- Java 8 will give you trouble, stick to 1. 7 as we did not try 1.6 anywhere.