-
Notifications
You must be signed in to change notification settings - Fork 10
Development Environment Setup
-
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
-
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_hometo be sure. Update your profile file to export your Java home directory env variable:nano ~/.profileAdd the line:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home -
Install maven. On Mac OS with homebrew:
brew install mvnorbrew install maven -
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
-
Make sure mysql is running. On Mac OS with homebrew:
brew tap homebrew/services brew services start mysql
-
Download Liferay 6.2 bundled with Tomcat (Community Edition) from http://www.liferay.com/downloads/liferay-portal/available-releases
-
Unzip downloaded bundle, let's call the target folder
XCOLAB_BUNDLES_DIR -
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). -
Remember to change permissions in tomcat's bin folder for executable flags to all scripts
$chmod +x *.sh -
Clone XCoLab GitHub repository: https://github.com/CCI-MIT/XCoLab. Lets call the directory to which the repository was downloaded
XCOLAB_SRC. -
Create a file at you user directory home with the name .xcolab.application.properties
-
Copy file
XCOLAB_SRC/microservices/services/src/main/resources/application.propertiesto~/.xcolab.application.propertiesand edit it to match your local configuration for mysql and your (fake) smtp server -
Copy file
XCOLAB_SRC/conf/deploy.propertiesto~/.xcolab.deploy.properties, edit that file and setliferay.auto.deploy.dirtoXCOLAB_BUNDLES_DIR/deploy(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"). -
Now it's needed to put all "parent" artifacts in local maven repository, execute
mvn install -Nin following dirsXCOLAB_SRC XCOLAB_SRC/taglibs XCOLAB_SRC/themes XCOLAB_SRC/services XCOLAB_SRC/portlets XCOLAB_SRC/hooks XCOLAB_SRC/layouts XCOLAB_SRC/microservices XCOLAB_SRC/microservices/util -
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 -
Now put all missing "parent" artifacts in local maven repository, execute
mvn install -Nin following dirsXCOLAB_SRC/microservices/clients XCOLAB_SRC/microservices/services -
Install the client libraries. Make sure you install admin-client and members-client first, as other clients depend on them. You can use following bash script:
cd XCOLAB_SRC/microservices/clients/admin-client mvn clean compile package install clean cd ../../.. cd XCOLAB_SRC/microservices/clients/members-client mvn clean compile package install clean cd ../../.. 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 -
Install plansProposalsFacade-service
cd XCOLAB_SRC/services/plansProposalsFacade mvn install -N cd XCOLAB_SRC/services/plansProposalsFacade/plansProposalsFacade-portlet-service mvn compile package install
-
install common taglibs/libraries
cd XCOLAB_SRC/taglibs/colabIceFacelets mvn compile package install cd XCOLAB_SRC/taglibs/colabJspTags mvn compile package install
-
Install plansProposalFacade-portlet
cd XCOLAB_SRC/services/plansProposalsFacade/plansProposalsFacade-portlet mvn compile package liferay:deploy -DskipTests=trueif you get a mvn error while maven is downloading the file
jdbc-stdext-2.0.jarorjta-1.0.1B.jar, you can manually download it and install it with the following command (executed in the folder that contains the jar):mvn install:install-file -Dfile=jdbc-stdext-2.0.jar -Dpackaging=jar -DgroupId=javax.sql -DartifactId=jdbc-stdext -Dversion=2.0 mvn install:install-file -Dfile=jta-1.0.1B.jar -Dpackaging=jar -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1B
Note that you need to deactivate tests by adding the skipTests flag:
mvn compile package liferay:deploy -DskipTests=true -
Install theme, layout tmpl and hooks
cd XCOLAB_SRC/themes/climatecolab-theme mvn compile package liferay:deploy cd XCOLAB_SRC/layouts/climatecolab-layout mvn compile package liferay:deploy cd XCOLAB_SRC/hooks/climatecolab-hooks mvn compile package liferay:deploy
-
Install all portlets
cd XCOLAB_SRC/portletsfor each PORTLET go to PORTLET directory and execute:
mvn compile package liferay:deploy(you can use following bash script, which is also located at
XCOLAB_SRC/portlets/deployALL.sh).for D in *; do if [ -d "${D}" ]; then cd $D pwd mvn compile package liferay:deploy cd .. fi done
-
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 -
Edit file
XCOLAB_BUNDLES_DIR/tomcat-xxx/conf/context.xmlinside add definition of jdbc/LiferayPool resource, IE:
<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/LiferayPool" password="liferay" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/xcolab?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false" username="liferay"/>
By editing the 'server.xml' file, you can also set the port (if 8080 doesn't work, try 8081).
-
Copy
XCOLAB_SRC/conf/portal-ext.propertiestoXCOLAB_BUNDLES_DIR/tomcat-xxx/webapps/ROOT/WEB-INF/classes -
Copy images
mkdir XCOLAB_BUNDLES_DIR/tomcat-7.0.42/webapps/ROOT/WEB-INF/classes/images cp XCOLAB_SRC/conf/member_photo.png XCOLAB_BUNDLES_DIR/tomcat-xxx/webapps/ROOT/WEB-INF/classes/images/
-
Create a database that uses "utf8mb4 collation" encoding and specify a user & password (for the
context.xmlset above, it's liferay:liferay).:mysql -u liferay -p CREATE DATABASE xcolab CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -
Import newest database dump (ask Patrick for it):
cat dump.sql.bz2 | bunzip2 | mysql -u liferay -p xcolab -
Change
XCOLAB_BUNDLES_DIR/tomcat-xxx/bin/setenv.shto increase PermGen and set the Java Home path for JDK 7. At least you should use an xmx of 2048 and permgen of 512, but preferrably more if you can. Make sure you set the path to JDK version 7, as version 8 will lead to runtime errors. -
Unzip simulation client lib into
XCOLAB_BUNDLES_DIR/tomcat-xxx/lib/extcd XCOLAB_BUNDLES_DIR/tomcat-xxx/lib/ext unzip XCOLAB_SRC/other/simulation-client.zip -
Download
document_library.zip(ask Patrick for it) and unpack it inXCOLAB_BUNDLES_DIR/data -
Edit
XCOLAB_BUNDLES_DIR/portal-setup-wizard.propertiesand verify the path to liferay.home is correct (/Users/pdeboer/Documents/liferay/liferay-portal-6.2.0-ce-ga1on my system) -
Run the liferay server:
XCOLAB_BUNDLES_DIR/tomcat-xxx/bin/startup.sh
-
Follow the server logs:
tail -f XCOLAB_BUNDLES_DIR/tomcat-xxx/logs/catalina.out
If you get the following exception: "The database contains changes from a previous upgrade attempt that failed.", modify the
Release_MySQL table and set thestate_column of all rows to 0:use xcolab; update Release_ set state_=0;. If you get an error that another version of Liferay is to be deployed, in theRelease_Table change the columnbuildNumberof the row withreleaseid= 1 according to your version of Liferay (e.g. 6201 for Liferay 6.2.1):use xcolab; update Release_ set buildNumber=6204 where releaseid=1; -
Start the microservice server:
XCOLAB_BUNDLES_DIR/apache-tomcat-8.0.33/bin/startup.sh
-
Follow the logs:
tail -f XCOLAB_BUNDLES_DIR/apache-tomcat-8.0.33/logs/catalina.out -
If you're working on one of our test servers: Reset the e-Mail settings (Control Panel / Server Admin / Mail. Set the credentials for the SMTP server to something that doesn't work)