Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated screenshots and took out unneeded importing steps (since SVN is not used)

...

Checkout Source and Create Project:

Panel
  1. # check out maven branch from http://svn.openmrs.org/openmrs/trunk.  From the toolbar, select VCS Checkout the desired branch – From the Toolbar go to VCS -> Checkout from Version Control > Subversion.This is no longer available since we have switched our code base from SVN to GIT.Try this link -> Github -> Source  https://github.com/openmrs/openmrs-core.git .

Image Removed

...


    1. This can also be achieved from the main IntelliJ Menu by selecting "Check out From Version Control"
  1. Image Added

  2. Image Added

  3. Clone the repository, select a parent directory
    Image Added


  4. IntelliJ will give a prompt to configure the detected frameworks

    Image Added

Panel
 

Develop with Maven

There are three modules defined in maven project, openmrs-api,openmrs-web and openmrs-webapp. OpenMrs is a parent project. When we run any maven goal on parent project, it will run the same goal on its children according to the dependency order. Common maven goals are shown under Lifecycle node. There are also goals provided by maven plugins which are shown under Plugins node.

...

Create a run configuration by click "Run -> Edit Configuration", click + and pick "Maven", type Name "OpenMRS", select working directory to be the root of webapp module, type goal "jetty:run" and save. Now you select "OpenMRS" and run or debug it.

Image Added

Image Added

Image Removed 

Current configuration of Jetty is that it will reload static resources like jsp, javascript files etc. If there is any java class change, It will require to run maven:compile goal and restart Jetty.

...

  1. Install JRebel plugin for Intellij IDEA and restart.
    Image RemovedConfigure JRebel plugin for Intellij IDEA.
    Image Removed
    Specify location of JRebel installation
    Image Removed
    Untick "synthetic fields"
    Image RemovedImage Added
    Image Added

    In Settings > Debugger > Java ; Untick "Synthetic Fields"

    Image Added

    In Settings > Debugger > Stepping ; Tick "Skip Synthetic Methods"

    Image Added

    Tick "Skip synthetic methods"
  2. Configure JRebel by running JRebel Configuration Wizard.

    Select "Intellij 8x or later", tick "Use maven to build my application", tick "I run the server from my IDE"

    Untick "Spring Framework Plugin"
  3. Run or Debug "OpenMRS" with JRebel from "Run -> Run/Debug with JRebel"

...