Developer Guide

This developer's guide provides documentation on how to build,deploy & test the application. But also to encourage Hacktivism and give people enough knowledge on how to develop their own web applications using Maven, Hibernate, Spring, & thinwire..

Requirements

To build and run the Citizen Intelligence Agency you need to install the following software.

Getting the Source Code

The source can be checked out anonymously from SVN with this command:

$ svn checkout https://cia.svn.sourceforge.net/svnroot/cia/trunk/citizen-intelligence-agency citizen-intelligence-agency

Setting up the Mysql database user

The command below describes how you setup an database user that will be used by the application.

Unzip the sql content file & start the mysql command line tool with this command:

$ cd src/main/data

$ unzip ia_dev.sql.zip

$ mysql -u root (-p if you have mysql password set)

and execute the following command

mysql> GRANT ALL PRIVILEGES ON *.* TO 'eris'@'localhost' IDENTIFIED BY 'discord' WITH GRANT OPTION;

import data can be found at src/main/data/ia_dev.sql and use the maven profile skip-db to disable database recreation or execute commands below

mysql> create database ia_dev default charset utf8;

mysql> use ia_dev;

mysql> source ia_dev.sql;

Build the application & run test

Now everything should be ready for you to build the application, execute the following commands to build & run

$ mvn clean package -Pdev,skip-db -Dtest=none -DfailIfNoTests=false

$ mvn jetty:run -Pdev,skip-db -Dtest=none -DfailIfNoTests=false

or using convenient ant task

$ ant run

This will build build a .war file and start en embedded jetty instance

NOTE: Set the variable MAVEN_OPTS="-Xmx1024m -Xms512m -XX:MaxPermSize=512m" if you get java memory exception.

Test Citizen Intelligence Agency

Now if everything has started successfully you should be able to view Citizen Intelligence Agency at http://localhost:8080/thinwire (or vaadin)

Eclipse development

If you want to do any serious development I would recommend that you install the latest version of Eclipse http://www.eclipse.org/downloads/ and also add the following plugins below.

  • Install SVN client subversive
  • Subversive Update Site is a part of Galileo Update Site.
  • Look at Help > Install New Software... > select Galileo - http://download.eclipse.org/release/galileo > Collaboration Tools
  • http://community.polarion.com/projects/subversive/download/eclipse/2.0/galileo-site/ - [required] Subversive SVN Connectors
  • http://community.polarion.com/projects/subversive/download/integrations/galileo-site/ - [optional] Subversive Integrations
  • Install m2eclipse , instructions at http://m2eclipse.sonatype.org/
  • OPTIONAL plugins below..
  • Spring IDE, update site: http://springide.org/updatesite/
  • Install Jautodoc , update site http://jautodoc.sourceforge.net/update/
  • Install EclEmma, update site http://update.eclemma.org/
  • Install Eclipse cs, update site http://eclipse-cs.sf.net/update
  • Install Jdepend for eclipse, update site http://andrei.gmxhome.de/eclipse/
  • Install Pmd for eclipse, update site http://pmd.sourceforge.net/eclipse
  • Install Findbugs for eclipse, update site http://findbugs.cs.umd.edu/eclipse/