Skip to content

Development Environment Setup

klemens-mang edited this page Nov 8, 2014 · 16 revisions

Required Software

  1. JDK 7 (http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html)
  2. MySQL Server (http://dev.mysql.com/downloads/mysql/)
  3. Maven (http://maven.apache.org/download.cgi, On Mac OS X installable through homebrew: brew install mvn)

Setup for Development

Prepare Database

  1. Using mysql create a database called simulation with default char set utf8 and default collation utf8_general_ci
  2. Create a new user with a password and access rights from your machine. For this guide we will use msandbox@localhost with password msandbox).
  3. Grant all rights on simulation to the user you created in the previous step.
  4. Import the SQL dump simulation.sql using the command line tool: mysql -u msandbox -p simulation < ./simulation.sql. (GUI MySQL Tools have proven to fail in this step so please stick to the command line tools)

Setup the webserver

ROMA uses the tomcat7 servlet engine. Since the CoLab platform is using the same servlet engine and is mainly developed side-by-side with ROMA we will use the tomcat7 instance that comes with Liferay for this guide. Please note, if you want to use an independent tomcat7 instance steps will slightly differ from what is presented here.

1.) The Liferay tomcat instance comes without the manager webapp that we will use for deployment. Therefore shut down your instance download a fresh tomcat from http://tomcat.apache.org/download-70.cgi and copy the webapps/manager folder to your already existing one. You can deleted the rest of the downloaded files as they will not be needed anymore.

2.) Configure the default admin user for your tomcat manager application in order to be able to deploy later on without additional configuration. Therefore modify conf/tomcat-users.xml in your existing tomcat folder and add:

<tomcat-users>
   <role rolename="manager-gui"/>
   <role rolename="manager-script"/>
   <role rolename="manager-jmx"/>
   <role rolename="manager-status"/>
   <role rolename="admin-gui"/>
   <role rolename="admin-script"/>
   <role rolename="manager"/>
   <role rolename="tomcat"/>
   <user username="admin" password="" roles="tomcat,manager,manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
</tomcat-users>

3.) Restart your tomcat server. You should be able to access http://localhost:8080/manager/html at this time as admin and without a password.

Deploy the code

1.) Clone the repository from https://github.com/CCI-MIT/ROMA.git.

2.) Import the code into your IDE preferably using the provided maven files.

3.) Review the file server/src/main/java/resources/META-INF/spring/database.properties and check that username, password, database and port are correct. You can check on which port your local mysql instance is running by executing:

SHOW GLOBAL VARIABLES LIKE 'PORT';

4.) Install roma-core by going to the core directory and executing: mvn compile package install

5.) Go to the client directory and execute mvn compile package dependency:copy-dependencies with an optional -Dmaven.test.skip=true if tests fail. Copy all .jar files from client/target/dependency to your tomcat instance's lib/ext directory. Also copy client-1.3-SNAPSHOT.jar to lib/ext. Restart your tomcat instance.

6.) Deploy the roma-server using mvn compile package tomcat7:deploy If the deployment fails due to tests use the option -Dmaven.test.skip=true.

7.) You should be able to access http://localhost:8080/roma-server/ at this time showing a simple administration interface for ROMA.

Configure your local Climate CoLab instance to use the local ROMA server (optional)

1.) Modify XCOLAB_BUNDLES_DIR/tomcat-[version number]/webapps/ROOT/WEB-INF/classes/portal-ext.properties and set edu.mit.roma.address=http://localhost:8080/roma-server. Restart your tomcat instance.

Clone this wiki locally