Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

This page is outdated and no longer receives updates!

Panel
titleBGColorCCC
titleRequirements

Panel
titleBGColorCCC
titleTable of Contents
Table of Contents

Checkout Source and Create Project

  1. File → New → Project → Checkout Maven Projects From SCM

...

  1. For SCM, choose 'svn' and browse to the project (http://svn.openmrs.org/openmrs/trunk)

...

  1. In older versions of the m2eclipse Eclipse plugin (prior to 0.11.0), you have an option to place all modules within a single project; this feature is deprecated as of m2eclipse 0.11.0.
    Click Advanced, and uncheck "separate projects for modules" (if that doesn't exist, change m2eclipse setting in Window → Preferences → Maven → Support multiple maven modules)

  2. Click Finish to download and create the Maven project(s).

Note: If you get the following error while trying to check out the code, switch the SVN URL from http to https. (i.e. https://svn.openmrs.org/openmrs/trunk)

...

There are five projects shown in the workspace: openmrs, openmrs-api, openmrs-test, openmrs-tools, openmrs-web, and openmrs-webapp. The openmrs project is a parent project. When we run any maven goal on the parent project, it will run the same goal on its children, according to the dependency order. A Maven menu item is added on the context menu, which lets you modify the pom.xml, manage dependencies and plugins, etc. Common maven goals are also added on the menu items Run As and Debug As. You can also create your own Maven Run Configurations.

How to run the build

  • Right click the openmrs project to bring up the context menu, select "Run as → Maven build..." (notice the "..." at the end)

...

  • Enter the Goals: clean install

  • Make sure the Maven Runtime at the bottom is correct for your installation (Configure for Embedded/External as necessary)

  • Select Apply, then Run

...

  • The build output will be displayed in the Console.

  • The output contains links to the results of each test.

To re-run the build, right click the root project to bring up the context menu, select "Run as -> Maven build."  If you have multiple configurations, select the "clean install" one to run.

...

On the JRE tab, in the VM parameters box, you will want to put in your memory parameters, e.g.

Code Block

-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:NewSize=128m

...

Set up a run configuration as specified in "How to Run Web Application" but in the JRE tab, set the -agentpath VM option as specified in the YourKit docs. Common values:

  • Linux x86, 32-bit Java: -agentpath:<profiler directory>/bin/linux-x86-32/libyjpagent.so

  • Mac OS X: -agentpath:<profiler directory>/bin/mac/libyjpagent.jnilib

  • Windows, 32-bit Java: -agentpath:<profiler directory>\bin\win32\yjpagent.dll

(This assumes you have YourKit installed already.)

...

Here is how you configure JRebel to work with OpenMRS

  1. Download JRebel and install it. http://www.zeroturnaround.com/jrebel/current/

  2. Install JRebel plugin for Eclipse and restart.
    http://archive.openmrs.org/wiki/Image:Eclipse-jrebel1.jpg

  3. Configure JRebel plugin for Eclipse.
    http://archive.openmrs.org/wiki/Image:Eclipse-jrebel2.jpg
    Specify location of JRebel installation
    http://archive.openmrs.org/wiki/Image:Eclipse-jrebel3.jpg

Tick "Use Step filters" and also add com.zeroturnaround.* and org.zeroturnaround.* to the filters Tick "filter synthetic fields"

  1. Configure JRebel Agent Setting provided by JRebel installation
    http://archive.openmrs.org/wiki/Image:Eclipse-jrebel4.jpg
    Untick "Spring Framework Plugin"

  2. Change "OpenMRS" Run configuration to increase Permgen and enable JRebel.
    http://archive.openmrs.org/wiki/Image:Eclipse-jrebel5.jpg

  3. Run or Debug "OpenMRS"

When you change any java classes, just wait for eclipse auto build to finish, reload the web page, and JRebel will reload the class for you.