Installing tDAR
Set up the environment
- Download and install Maven 2 from http://maven.apache.org
(if behind a proxy don't forget to configure your Maven settings file appropriately) - check out the codebase from our bitbucket repository:Â https://bitbucket.org/tdar/tdar.src
- install the prerequisites:
- PostgresSQL - 9.1 (Harris+)
- Postgis
- Tomcat (production only)
- Atlassian Crowd or an LDAP server
- set up the database:
Setup "tdar" user:
psql consolecreate user tdar with CREATEDB; GRANT USAGE ON LANGUAGE plpgsql TO tdar;
setup the databases and load the sample data
run scriptsrc/main/db/load_tdarmetadata_database.sh
- To setup the tdardata database and tdargis database, locate the zip files in the https://bitbucket.org/tdar/tdar.support repository
- setup the tdargis database as a postgis database
- load the sql for each zip file into the corresponding database
- set up the instance by performing the following:
- make sure you have a tdar user with CREATEDB permissions on postgres
run the maven setup task:
mvn -Psetup-new-instance compile
- setup auth environment
- in src/main/resources/ find the requisite config file (crowd.properties, ldap.properties)
- configure as needed
- Make sure that the auth system has the following groups:
tdar-admins
tdar-editors
tdar-users
setup the dev environment
- use
mvn eclipse:eclipse
to generate Eclipse's.project
&.classpath
files, then addM2_REPO
to the variables viaBuild Path -> Add Variable
and set it to your local Maven 2 repository. On Unix-ish machines, this should be~/.m2/repository
. If you're using the m2eclipse plugin , this step usually isn't necessary. - (on GRID and before) to make google maps work on your development box, copy
src/main/webapp/includes/googlemaps-api-key.js.template
tosrc/main/webapp/includes/googlemaps-api-key.js
and then customize it by changing the gmapsKey variable to the google maps api key for your host. You can get a google maps api key at http://code.google.com/apis/maps/signup.html
#Important maven targets include:mvn compile
mvn test
mvn jetty:run
to deploy the webapp on the port specified inpom.xml
mvn verify
to run the unit and integration tests
Maven dependencies
To add new library dependencies, you can look them up via a repository search engine like http://mvnrepository.com or http://search.maven.org (see http://maven.apache.org/general.html#How_to_find_dependencies for more repository search engines). If so, add the pom snippet to the pom.xml, otherwise you may need to install it manually in our local maven staging repository. You can also add maven repositories to Archiva as a proxy connector, which will keep our pom.xml simpler.
Code Formatting:
- Go into eclipse preferences
- Navigate to Java > Code Style > Formatter
- Click import and import the eclipse format file