Module setup
Before setting up the generic web application, checkout the snapshot and release module artifacts. If the code changes that you need have not been uploaded to maven, create a Pull Request in the relevant repository. Once the PR has been reviewed and approved, merge it to the master branch and upload the new artifact to maven. We have listed the modules that we currently have on the server side here.
Update pom.xml and set the correct versions for core, connector and register dependencies.
Update the following files with password credentials (MySQL, PostgreSQL and CouchDB)
- config/assets/config/couchdb.properties
- config/assets/config/opensrp.properties
- src/main/resources/quartz.properties
- src/main/webapp/META-INF/context.xml
- config/assets/migrations/environments/development.properties
NB: The config folder is a git submodule that holds server-wide properties. Checkout the following documentation for more info.
If you are using PostgreSQL as the main data store, checkout this documentation on how to run MyBatis migrations.
Generic Web profiles
The generic web app https://github.com/OpenSRP/opensrp-server-web has four major profiles defined in the pom file.
These are: couchdb, postgres, jedis and lettuce. Couchdb and Postgres profile are used to define the main data store while Jedis and Lettuce, the redis client to use.
Postgres and Jedis are activated by default and they will be active profiles when you run the following command
mvn clean package
But when you specify a property, the active ones are overriden. Couchdb will be the only active profile when you run the following command
mvn clean package -P couchdb
This means that the redis client won't be defined.
To fix this, provide data store and redis client property types
mvn clean package -P couchdb,jedis
Deployment
Once tomcat is running, you can install the opensrp.war file from target folder into the webapps directory in order to run the application.
sudo cp target/opensrp.war /var/lib/tomcat7/webapps/