Versions Compared

Key

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

Instructions for using eclipse for development on mifosx.

Info
titleNote

Run/Debug apache Fineract from the IDE will not work due to OpenJPA Dependency. Just Use remote debugging as of now just start the Fineract using `./gradlew tomcatRunWar`

Eclipsify your application

  • Move into the fineract-provider directory.

Execute the following:

Code Block
languagebash
./gradlew -Penv=dev clean cleanEclipse eclipse
Info

Execute this task everytime you add new dependencies

when this finishes do :

Code Block
languagebash
./gradlew -Penv=dev clean war
Info

./gradlew tasks shows all tasks that can be executed in each directory.

Panel

On this page:

Table of Contents

Import project into eclipse

Create a new directory for your eclipse workspace. e.g. c:/dev/eclipse-workspaces/mifosx-github

Start up Eclipse (assuming its already installed)

Use the workspace directory you just created.

When opened, in the package explorer of the java perspective, right-click import->General->Existing projects into workspace. In the dialog that opens, specify the root directory option by browsing to and selecting the mifosx directory that was cloned e.g. c:/dev/githubrepos/mifosx

This should pick up on the fineract-provider project you just 'eclipsified' in last step. ClickFinish to import into workspace.

Note: You may see eclipse warning to do with 'Serializable'. Goto Window->Preferences->Java->Compiler->Errors/Warnings. In the Potential programming problems section choose 'ignore' for 'Serializable class without serialVersionUID:' option.

You may see eclipse warning to do with 'Unnecessary Suppress Warnings Unused'. Goto Window->Preferences->Java->Compiler->Errors/Warnings. In the Annotations section choose 'ignore' for 'Unused @SupressWarnings token:' option.

Alternatively you can use gradle tooling for eclipsehttp://dist.springsource.com/release/TOOLS/gradle

Apply Project preferences to Eclipse

Import MifosX Eclipse Preferences from /mifosx/config/mifosxdev-eclipse-preferences.epf to Eclipse using File->Import->General->Preferences on Eclipse

Right click on fineract-provider project -> Properties -> Java Code Style

  1. Ensure the Active profile selected for "Clean Up" is "mifosxdevprofile"
  2. Ensure the Active profile selected for "Formatter" is "mifosxdevprojectformatter" (Ctrl+Shift+F to format selected content or file / To format all files in package, Right click on package -> Source -> Format)

Note: You may need to reset the Active profiles for "Clean Up" and "Formatter" every time you "Eclipsify" the application

Run/Debug Mifos X 

Run/Debug as Java application ServerWithMariaDB4jApplication to launch Mifos X with an embedded database (Separate installation of MySQL is not required) OR if you have installed MySQL in the previous step, run/debug ServerApplication as a Java application.

Remote debugging through eclipse

On the debugger (see menu icon that looks like a bug/spider), choose Debug configurations...

  1. Select Remote Java Application from list of configurations and click the icon on top forNew launch configuration
  2. For name enter something like: Remote debug mifosx platform
  3. In connect tab, ensure the followingIn common tab, tick of dispay in favourites for Debug
    • project: fineract-provider
    • Host: localhost
    • Port: 8005 (or whatever you chose when adding remote debugging paramaters in the setting up gradle section)

Apply/Save these changes and select the saved launch configuration from your debug menu to attach the debugger to the already running mifosx platform (if the platform isnt running you will get message from eclipse saying it cant attach to JVM etc)

Eclipse Shortcuts

https://www.catalysts.cc/en/wissenswertes/intellij-idea-and-eclipse-shortcuts/

http://www.shortcutworld.com/en/win/Eclipse.html

Please refer to https://github.com/apache/fineract/ for how to set-up Eclipse and contribute to Fineract (formerly known as Mifos X).