Wiki

Version 2 (Anonymous, December 05, 2013 10:18)

1 1 Anonymous
h1. Development Environment
2 1 Anonymous
3 1 Anonymous
This page serves as a guide for developers to set up the dev env required for participating in AgroBank RIB project. It's maintained as a wiki so that everyone be able to improve it by contributing his/her experiences throughout the process of configuring and building the project. 
4 1 Anonymous
5 1 Anonymous
If you're one of the developers, it is also recommended to add this page to your watch list, so that you get notification about any change in the environment settings.
6 1 Anonymous
7 1 Anonymous
h2. Source Code Repository
8 1 Anonymous
9 1 Anonymous
https://hub.penril.net/hg/agrobank/agro_rib/ (A _Mercurial_ Repository)
10 1 Anonymous
11 1 Anonymous
h2. Build Tools
12 1 Anonymous
13 1 Anonymous
The project definition, its dependencies and other build configs are defined in a file in its root folder named *@pom.xml@* (project’s Object Model). This file is used by "_Apache Maven_":http://maven.apache.org/ to build the project. Apache Maven is de facto Java buid management tools that decouple your project structure from IDEs. On the other hand, it's so popular that all Java IDEs have developed plugins to integrate and interpret Maven projects into their expected structures. Another benefit of build tools like Maven is that the project can be build automatically using Continuous Integration servers, like _Jenkins/Hudson_ in our case.
14 1 Anonymous
15 1 Anonymous
In order to run @mvn@ (Maven command) outside your Eclipse environment you need to download Maven binaries from "here":http://maven.apache.org/download.html#Maven_2.2.1 and install it following these "instructions":http://maven.apache.org/download.html#Installation .
16 1 Anonymous
17 1 Anonymous
Make sure you select *Maven 2.2.1* as this is the version used in this project.
18 1 Anonymous
19 1 Anonymous
h3. Configuring Maven to point to Penril's Maven repo
20 1 Anonymous
21 1 Anonymous
To speed up downloading of _artifacts_ required by Maven, a cache proxy is configured at https://staging.penril.net/nexus/ . All you need to force Maven to use this mirror is to put *@settings.xml@* file (attached to this wiki) in your *@${user.home}/.m2@* directory (For the default value of @user.home@ for your system refer to this "table":http://en.wikipedia.org/w/index.php?title=Home_directory&oldid=429870583#Default_Home_Directory_per_Operating_System ). 
22 1 Anonymous
23 1 Anonymous
h2. Eclipse Plugin for Maven2
24 1 Anonymous
25 1 Anonymous
*_m2eclipse_* is the recommended plugin to import Maven projects into Eclipse workspace. You can find the installation guide on http://m2eclipse.sonatype.org/installing-m2eclipse.html. Make sure you install both:
26 1 Anonymous
* _Maven Integration for Eclipse (Required)_ from *m2eclipse Core*
27 1 Anonymous
* _Maven Integration for WTP_ from *m2eclipse Extras*
28 1 Anonymous
 
29 1 Anonymous
h2. Building The Project
30 1 Anonymous
31 1 Anonymous
As mentioned above, there are two ways to build the project:
32 1 Anonymous
33 1 Anonymous
h3. Using command line (IDE-independent)
34 1 Anonymous
35 1 Anonymous
You can build the project simply by changing the directory to project's root folder (where @pom.xml@ resides) and executing @mvn@ command, passing @install@ as the build lifecycle
36 1 Anonymous
<pre>$ mvn install</pre>
37 1 Anonymous
38 1 Anonymous
h3. Using IDE plugins (m2eclipse in this case)
39 1 Anonymous
40 2 Anonymous
"m2eclipse makes development easier by integrating data from a project's Object Model with Eclipse IDE features." - "m2eclipse homepage":http://m2eclipse.sonatype.org/
41 1 Anonymous
42 1 Anonymous
Using this plugin you can build and run your project the same way you perform this tasks for any other project created by Eclipse itself.
43 1 Anonymous
44 1 Anonymous
*NOTE: For working with the project inside Eclipse, make sure you add the project to the workspace using _"import Maven project"_ feature of Eclipse, and do it only after you successfully installed both _m2eclipse_ plugins mentioned above.*