Instructions for using eclipse for development on mifosx.
Eclipsify your application
- Move into the fineract-provider directory.
Execute the following:
Code Block | ||
---|---|---|
| ||
./gradlew -Penv=dev clean cleanEclipse eclipse |
Info |
---|
Execute this task everytime you add new dependencies |
when this finishes do :
Code Block | ||
---|---|---|
| ||
./gradlew -Penv=dev clean war |
Info |
---|
|
Panel | |
---|---|
On this page:
|
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 mifosng-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 mifosng-provider project -> Properties -> Java Code Style
- Ensure the Active profile selected for "Clean Up" is "mifosxdevprofile"
- 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
(Not recommended as default workflow is running the application through the IDE but useful for debugging if application is running remotely)
On the debugger (see menu icon that looks like a bug/spider), choose Debug configurations...
- Select Remote Java Application from list of configurations and click the icon on top forNew launch configuration
- For name enter something like: Remote debug mifosx platform
- In connect tab, ensure the followingIn common tab, tick of dispay in favourites for Debug
- project: mifosng-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/
...
Please refer to https://github.com/apache/fineract/ for how to set-up Eclipse and contribute to Fineract (formerly known as Mifos X).