Skip to content

Development Environment Setup

Carlos Paula edited this page Feb 21, 2017 · 75 revisions

Required Software

  1. Install Java JDK 7 and JDK 8 from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html and http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  2. Determine the Java home directory path (for JDK 8). Under Mac OS it's usually similar to /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home, but run /usr/libexec/java_home to be sure. Update your profile file to export your Java home directory env variable:

    nano ~/.profile

    Add the line:

    export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
  3. Install maven. On Mac OS with homebrew: brew install mvn or brew install maven

  4. Install mysql. On Mac OS with homebrew:

    brew install mysql
    mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
  5. Make sure mysql is running. On Mac OS with homebrew:

    brew tap homebrew/services
    brew services start mysql

Setup for Development

  1. Lets call our deployment folder XCOLAB_BUNDLES_DIR

  2. Download tomcat 8 and unzip it in XCOLAB_BUNDLES_DIR. The tomcat root directory should be XCOLAB_BUNDLES_DIR\apache-tomcat-8.0.33. Make sure you use that exact name (including the version).

  3. Remember to change permissions in tomcat's bin folder for executable flags to all scripts
    $chmod +x *.sh

  4. Clone XCoLab GitHub repository: https://github.com/CCI-MIT/XCoLab. Lets call the directory to which the repository was downloaded XCOLAB_SRC.

  5. Create a file at you user directory home with the name .xcolab.application.properties

  6. Copy file XCOLAB_SRC/microservices/services/src/main/resources/application.properties to ~/.xcolab.application.properties and edit it to match your local configuration for mysql and your (fake) smtp server

  7. Copy file XCOLAB_SRC/conf/deploy.properties to ~/.xcolab.deploy.properties, edit that file and set liferay.auto.deploy.dir to XCOLAB_BUNDLES_DIR/deploy (No need to create the deploy folder) (i.e.: liferay.auto.deploy.dir=/Users/Beatrice/projects/XCOLAB_BUNDLES_DIR/deploy Take care that you have no spaces around the equals-sign '=' or after "/deploy").

  8. Now it's needed to put all "parent" artifacts in local maven repository, execute mvn install -N in following dirs

    XCOLAB_SRC
    XCOLAB_SRC/microservices
    XCOLAB_SRC/microservices/util
    
  9. Install utility libraries

    cd XCOLAB_SRC/microservices/util/xcolab-utils
    mvn compile package install
    
    cd XCOLAB_SRC/microservices/util/service-utils
    mvn compile package install
    
  10. Now put all missing "parent" artifacts in local maven repository, execute mvn install -N in following dirs

    XCOLAB_SRC/microservices/clients
    XCOLAB_SRC/microservices/services
    
  11. Now we install entity utils dependencies by compiling with mvn clean compile package install clean :

    XCOLAB_SRC/microservices/clients/emails-client
    XCOLAB_SRC/microservices/clients/members-client
    XCOLAB_SRC/microservices/clients/admin-client
    XCOLAB_SRC/microservices/clients/comment-client
    XCOLAB_SRC/microservices/clients/activities-client
    XCOLAB_SRC/microservices/clients/modeling-client
    XCOLAB_SRC/microservices/clients/contestproposal-client
    
  12. Now we install entity-utils itself with mvn clean compile package install clean:

    XCOLAB_SRC/microservices/util/entity-utils/
    
  13. Install the client libraries. Make sure you install the clients on the step above first, as other clients depend on them. You can use following bash script:

    
    cd XCOLAB_SRC/microservices/clients
    for D in *; do
        if [ -d "${D}" ]; then
            cd $D
    	    	    pwd
    	    mvn clean compile package install clean
    	    cd ..
        fi
    done
    
  14. Create a database that uses "utf8mb4 collation" encoding and specify a user & password:

    mysql -u root -p 
    CREATE DATABASE xcolab
        CHARACTER SET utf8mb4
        COLLATE utf8mb4_unicode_ci;
  15. Import newest database dump (ask Patrick for it):

    cat dump.sql.bz2 | bunzip2 | mysql -u liferay -p xcolab 
    
  16. Install all services. You can use following bash script, which is also located at XCOLAB_SRC/deployServices.sh:

    cd XCOLAB_SRC/microservices/services
    for D in *-service; do
        if [ -d "${D}" ]; then
            cd $D
            pwd
            mvn clean compile package spring-boot:repackage
            cd ..
        fi
    done
    
  17. Start the microservice server:

    XCOLAB_BUNDLES_DIR/apache-tomcat-8.0.33/bin/startup.sh
  18. Follow the logs:

    tail -f XCOLAB_BUNDLES_DIR/apache-tomcat-8.0.33/logs/catalina.out
    
  19. Compile the view layer with:

  20. Start the microservice server:

        sh XCOLAB_SRC/deployView.sh
  21. After all microservices have started at the apache server, start the view:

        cd XCOLAB_SRC/view/target
        java -Xmx4096M -Xms4096M -jar xcolab-view-1.0-SNAPSHOT.jar
  22. All should be ok just head to http://localhost:18082/ And the site will be there.

Clone this wiki locally