Developer Setup

Note: If you want to develop on the new MifosX platform, then refer to this page: Getting started - Contributing to MifosX

This page is about how to develop the Mifos platform.

Once you have the plugins, you should be able to get the code, build, and run Mifos.

Workspace 2.0 deprecates much of this page, see Workspace 2.0 first.

About the project

  • You must do a maven build from the commandline before using WTP
  • For convenience, the project is set to build using the Eclipse Java builder, which does not use maven. If you want to update dependencies via maven or just be sure that the project is being built correctly, you must build using maven from the command line: mvn clean install - the Java builder does not completely build the project, but only builds the class files, ftl files, and properties files.
  • You can use the maven builder from inside eclipse, but be warned - it's annoying, as it touches many files, causing Eclipse to frequently pop up dialog boxes.
    • In the Navigator pane, right click on the project
    • Select Builders
    • Uncheck the Java builder to disable it.
    • Check the Maven2 builder to enable it.
    • Now you can right-click on the project, and select the M2 menu for maven goals.
  • The project uses PMD and FindBugs as poka-yoke (mistake proofing) tools to help us catch bugs before checking them into source control.

Get a local copy of the Mifos source code

See Mifos Version Control Guide

Building

  • From the command line
    • ``mvn clean install`` will build the project, placing the war)] in the target/ directory. This will run the acceptance tests. To run only the unit tests, run 'mvn clean test'. To run only the acceptance tests, run 'mvn integration-test'.
    • More about the Maven Build.
    • More about Running Acceptance Tests.
    • More about Hudson Continuous Integration - our build server builds and tests automcatically, doublechecking the tests developers run on their desktop machines.

Configure Eclipse

Please apply the following Workspace (not Project) Preferences:

  • General > Content Types > Java Properties File : Default encoding, type "UTF-8  " and click Update
    • because Mifos Translation .properties files are UTF-8   encoded (while standard Java properties files are ISO-8859  -1); see MIFOS-4851   for some background about this
  • General > Editors > Text Editors > Insert spaces for tabs (instead of tabs)
  • Web > CSS Files > Editor > Indent using spaces (instead of tabs)
  • Web > HTML Editor > Indent using spaces (instead of tabs)
  • XML > XML Files > Editor > Indent using spaces (instead of tabs)
  • XML > XML Files > Editor > Indentation size: 4 (instead of 1)

Configure PMD

  • No configuration should be necessary, as settings are checked into source control.
  • However, to see the settings:
    • General preferences are set in Window → Preferences → PMD
    • Project settings are here: Navigator Pane → right click → Properties → PMD

Configure FindBugs

  • No configuration should be necessary, as settings are checked into source control.
  • However, to see the settings:
    • Project settings are here: Navigator Pane → right click → Properties → Find Bugs

To see the Maven2 console

  • Set Eclipse to build automatically.
  • Do Window → Show View → Console, then click the pushpin icon to "pin" the console.
  • Click the Console tab
  • Click the Window + icon and select Maven console from the drop down menu.
  • Click the Monitor triangle icon and select the Maven console.

To see the Tomcat console

  • Click the console tab
  • Click the Window + icon and select new console.
  • Click the pushpin icon to "pin" the console.
  • Click the Window + icon and select Tomcat console from the drop down menu.
  • Click the Monitor triangle icon and select the Tomcat console.

Resource Filtering in Eclipse

Operations like Search → File and Navigate → Open Resource generally return lots of useless and/or unrelated results. A handy way to see just what you want is by limiting scope using Working Sets.

While the "Java" perspective is enabled, go to Window → Working Sets → Edit and create a working set called "UsefulMifos" containing only items useful in Mifos development. Suggested inclusions:

  • all of X/src/X/resources
  • all of X/src/X/java
  • mifos/build.xml
  • pom.xml
  • README, INSTALL, AUTHORS, LICENSE

Now you can configure views to use this filter. In the Package Explorer view, click on the dropdown (upside down triangle) and choose "Select Working Set...". Choose "Window Working Set" in the dialog that pops up. Configure the Navigator and Problems views similarly. Search → File, Navigate → Open Resource, and Navigate → Open Type all have options to filter by Window Working Set.