Versions Compared

Key

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

This page is outdated and no longer receives updates!

These instructions describe how to load OpenMRS into Eclipse version 3.4.2 using the Maven Eclipse Plugin. Eclipse and Maven are assumed to be installed previously.

Setup Eclipse Workspace for Maven

Run the follow command from the command line at the root of the SVN checkoutchecked out project:
mvn eclipse:configure-workspace -Declipse.workspace=<path-to-eclipse-workspace>

...

On starting Eclipse, select the <path-to-eclipse-workspace> used in the previous step.
If Eclipse is already started, switch the workspace by File -> Switch Workspace -> Other... and select the workspace path.

...

  • Verify the workspace is configured properly by going to Windows -> Preferences.

  • Java -> Build Path -> Classpath Variables should contain a variable named M2_REPO.

  • Java -> Code Style -> Formatter should have the Active profile of 'OpenMRS Formatter'

Setup Maven commands in Eclipse

...

Select the newly created variable name for the Location, and enter the path to the checked out OpenMRS svn checkout project as the Working Directory.
Enter the Arguments for the eclipse command:
eclipse:eclipse --batch-mode -DdownloadSources=true

...

Follow the same steps for adding other Maven commands.
For the build command, enter these the Arguments:
clean install --batch-mode

...

Generate Eclipse Projects

...

Browse to the location of the checked out OpenMRS svn checkout project and select the three OpenMRS projects (api, web, webapp)

...

Update Eclipse View

A suggestion is to use the Java perspective with the Referenced Libraries node.
Change the perspective by Window -> Open Perspective -> Java

...