MoK Projects

Attenzione: For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [xwiki:MoK.Projects.WebHome]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.

Technical info

The second goal described above states "make students work on state-of-art research topics using widely adopted technologies". This means that it is important for you to learn using the right tools for developing software products: besides being useful for boosting your productivity, it will be extremely valuable in your future workplace. Accordingly, all the projects must be developed using the following tools:

  • Java, as the main programming language and execution platform (some projects may require other languages for specific tasks)
  • Eclipse, as the reference IDE (featuring some invaluable plugins I'd like for you to adopt, e.g. Checkstyle and FindBugs)
  • Maven, as project management tool of our choice (supporting coherent development of your software products and easy integration)
  • Git, as the distributed version control system of our choice (enabling distributed development and preventing you to break everything ;D)
  • Bitbucket, as the source code hosting service of our choice (enabling distributed development and preventing you to break everything ;D)

Usage is straightforward, nevertheless, here it is a quick how-to about setting up your working environment:

  1. Clone with Git the project codebase from its Bitbucket online repository into a custom folder on your machine. Git is a Distributed Version Control Systems, available from here, quick guide here. Either use Git from the command line or through a graphical client (e.g., SourceTree is available both under Mac and Windows). E.g., if using the command line, type (replacing username with your Bitbucket username) 
git clone https://username@bitbucket.org/smariani/mok-projects.git

 Folder 'mok-projects' should be created, storing the project codebase.

  1. Checkout the remote branch named after your group members' surnames (e.g., 'feature/surname1-surname2') on your local copy of the repository (that is, within folder 'mok-projects'). E.g., if using Git from the command line, type 
git fetch origin

 then 

git checkout -b feature/surname1-surname2 origin/feature/surname1-surname2

 If you now type 

git branch

 you should see two branches: 'master' and 'feature/surname1-surname2', the latter with an asterisk next to it.

  1. Open a new Eclipse workspace therein, that is, into the newly-created folder 'mok-projects'. You may use another IDE if you wish, but usage of Eclipse is warmly suggested, due to the following plugin I wish you to use.
  2. If necessary, download & install the Maven plugin for Eclipse, available from http://eclipse.org/m2e/
  3. If necessary, download & install the Checkstyle plugin for Eclipse, available from http://eclipse-cs.sourceforge.net/#!/
  4. If necessary, download & install the FindBugs plugin for Eclipse, available from http://findbugs.sourceforge.net
  5. Import all the Eclipse preferences from the cloned file 'Eclipse-prefs.epf', within folder 'mok-projects/mok/config/'. If successful, under 'Eclipse > Preferences > Java > Code Style > Clean Up' you should see 'TuCSoN' under label 'Active profile:'.
  6. Import the codebase you just cloned as a Maven project. Choose 'File > Import... > Maven > Existing Maven Projects' then choose 'mok-projects/mok' as the "Root Directory:". If successful, a number of Maven (Java) modules (projects) should appear in the "Package Explorer" view, decorated with a little 'M' in the upper-left corner of the project icon, and a little 'J' in the upper-right corner (except for project 'mok', which only has the 'M' label), as shown by the screenshot at the bottom of the page.
  7. If necessary, fix the directory structure of the imported projects according to the screenshot at the bottom of the page.
  8. Import Checkstyle preferences from the cloned file 'MoK-checkstyle.xml', within folder 'mok-projects/mok/config/'. Choose 'Eclipse > Preferences > Checkstyle > New', then 'Project Relative Configuration' next to label "Type", browsing to file 'mok-projects/mok/config/MoK-checkstyle.xml' (give it the name of your choice, doesn't matter). To finish, select the "Check Configuration" just imported then click on "Set as Default".
  9. Happy coding ;D

For any question, do not hesitate to mail Stefano Mariani!

ReSpecT    TuCSoN