Table of Contents
Table of Contents | ||||
---|---|---|---|---|
|
The Pre-requisites
- Eclipse for Java Developers 3.7 (Indigo). You might need to add -vm option to eclipse.ini file to point to a JDK e.g -vm C:\dev\java\jdk1.6.0_17\bin\javaw.exe see eclipse.ini wiki page.
...
Info |
---|
The "Eclipse for JavaEE" download package does not include the M2E Maven Integration for Eclipse as the Eclipse "for Java" distribution does (in Indigo at least) - so you would have to install M2E manually from http://www.eclipse.org/m2e/ with other packages. For Mifos testers it could be helpful to download Eclipse Java JEE Developers - http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/indigor |
The How-to-use-it? New Workspace Quick Start Guide
These screencasts walk through the quick start process:
Also ~andrewx991 AndrewH (Unlicensed)'s YouTube Channel has a series of very nice & useful screencasts how to set-up a development environment for Mifos!
...
- clone the mifos head repository, as per Mifos Version Control Guide
- On the very first use of the new workspace (only), you'll need to do an
mvn install
in the (new) mifos-reporting-libs Maven module, either via mvn CLI in thereporting-libs
directory or in mifos-report-libs project in Eclipse launch the mvn install launch configuration, to get the BIRT JARs which are not available on Maven central into your local Maven repo. - If you have any existing projects, switch to an entirely new, clean workspace using File -> Switch Workspace.
- in your Eclipse IDE, menu File → Import... → Maven, Existing Maven Projects
- Select root directory, Browse to where your git tree is
- Select All projects - there should be (at the time of writing this) about 16 of them (correctly set-up Eclipse .project & .classpath for all of them are in Git)
- do NOT check Copy projects into workspace (it's off/unchecked by default already)
- optional: In order to separate this set of projects from other projects in the workspace, it is best to use Eclipse working sets. Do this if you didn't Switch to a brand-new Workspace (above).
- in the Eclipse Package Explorer view, click that little downwards face (options) arrow icon
- change the Top Level Elements from Projects to Working Sets
- use Configure Working Sets to add a New... one named e.g. "Mifos", and Add → the mifos-* projects to its Working set content
- or, drag & drop the 16 or so mifos-* projects into/under the Working Set (unless during the creating of the working set already)
- or, it's possible to already do this directly during the Import > Existing Projects into Workspace wizard
- in the Eclipse Package Explorer view, click that little downwards face (options) arrow icon
- optional: connect eGit by marking all projects, right-clicking, Team > Share Project, Git, highlight/mark/check all the projects lines (they'll all have "Repository" column to '../.git', that's correct), Finish.
- if there is anything in red, do an F5 refresh of all the mifos-* projects
- if there are any "this or that JAR not found" issues in red, try right-click Maven > Update Dependencies (must have M2Eclipse installed)NEVER use right-click Maven > Update Project Configuration (revert and go back to the one in Git if you do so by mistake) - this would break the workspace, see Workspace 2.0 Eclipse Maven Settings
- if the rest/pom.xml shows the errors below, then right-click one of these error messages in the Problem View, and Quick Fix (Ctrl-1). Then use the second option to "Discover new m2e connectors" (do NOT "Permanently mark goal compile in pom.xml as ignored in Eclipse build"). Click Finish to install the AspectJ m2e configurator connector (AKA "Maven Integration for AJDT") from the M2 Marketplace.
- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.4:compile (execution: default, phase: compile)
- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.4:test-compile (execution: default, phase: test-compile)
- if there is anything in red, try right-click Maven > Update Project Configuration
- make sure there are no red build errors on all mifos-* projects anymore
- start-up the Mifos web application via the e.g. Mifos START 8080.launch Eclipse launch configuration in the mifos-server project by right-clicking 'Debug As...' (Starting starting directly as debug makes hot code replacement work - just make sure you have Project > Build Automatically ticked in eclipse).
- Mifos web application is now available at e.g. http://localhost:8080/mifos/ (make sure you don't by mistake use or copy/paste http://0.0.0.0:8080/mifos, as printed in the start-up logs
INFO org.eclipse.jetty.util.log WebApp@25468780 at
http://0.0.0.0:8080/mifos
andINFO org.eclipse.jetty.util.log Started SocketConnector@0.0.0.0:8080
)
...
PS: The order of projects within an Eclipse working set can unfortunately not be manually sorted in Eclipse (it would be nice if this could reflect the layering/build order); the only way would be appropriate e.g. numeric project name prefixes (but the existing standard convention of using artifactId may be better). - You can however move the Working Sets themselves up & down (Mifos vs. other sets of projects you have in your workspace).
Pro Tip: Close some of the modules in the workspace
You can speed up your workspace by closing some of the Mifos modules (Eclipse projects) which you are not actively working on.
M2E (the Maven integration for Eclipse) will automatically switch modules which depend on those you closed to use the JARs from your local repository.
If you do this, be careful that the binaries (JARs) of the modules you closed are fresh in your .m2 local repo; you may have to do a CMD "mvn clean install" in the respective module's directories, or right-click Run as > Maven clean & install before you close the projects.
Pro Tip: instant reloading of message bundles
Developers: set i18.messages.cacheSeconds=1
in your Local Properties File for instant reloading of i18n messages! See MIFOS-4557 4557 for details.
Coding Standards for Java Source Code Formatting
...
Note |
---|
This chapter documents how the Mifos Workspace 2.0 has been set-up. It is "background documentation" - you don't need to apply (or in-depth understand) what is described in this section to USE the new workspace. |
MIFOS-4099 4099 sub-tasks has some information which may be of "historical interest" re. how it all came about.
...
Version 7 of Jetty is used instead of a Jetty v8. Jetty v7 turns out to actually support (what we need of) Servlet 3.0 already, is stable, and ready as container for deployments. Jetty v8 (the next version of Jetty, which will officially support the Servlet 3.0 API) isn’t yet available as GA at the time of writing this. It should be simple to switch the workspace embedded Jetty to v8 later.
Due to MIFOS-4768 4768 , min. Jetty v7.3.0 must be used to deploy a mifos.war; previous versions (7.2.0 and 7.2.2) cause soe ClassCircularityError in BIRT.
...
BTW, did you know that Mifos has been using OSGi for quite a while already? BIRT actually internally uses OSGi, and via some classloader tricks in a WAR starts up an embedded OSGi container. That's what all the stuff in mifos-reporting/src/main/resources/META-INF/resources/WEB-INF/platform is for; the many *.jar under mifos-reporting/src/main/resources/META-INF/resources/WEB-INF/platform/plugins are not on the Maven-based classpath - BIRT finds and sets-up all that via the servlet context when it starts up.
MIFOS-4429 4429 has blurb that may be of interest if you want the full background.
...