(Detailed Design) Development envionment requirements - IKANOW/Aleph2 GitHub Wiki
This page is just a list of any non-standard setup that is required to build the code
- Maven must be installed and point to a JDK8 instance.
- JAVA_HOME needs to point to a JDK8 (And then after restarting eclipse, you may need to Maven>Update project to make errors go away) (the error you will see is "Missing jdk.tools.jar")
- Install EclEmma (And then after restarting eclipse, you may need to Maven>Update project to make errors go away)
- Tests/executables must be run with
-Dhadoop.home.dir=<PATH\TO>aleph2_storage_service_hdfs\win_hadoop_home -Djava.library.path=<PATH\TO>aleph2_storage_service_hdfs\win_hadoop_home\bin\hadoop.dll
- (this can be set in eclipse via Windows>Preferences>Java>Installed JREs>pick default JDK>edit>Default VM Arguments>add the 2 hadoop config parms above)
- (the extra hadoop.dll setting seemed to be necessary for some environments but not all)
- (note that standalone Hadoop still can't be launched in most Win8 environments - this is on the "to fix" list)
Building maven is somewhat not standard because of some circular dependencies (via the "test" scope) required for system testing performed using JUnit. Also because we build self contained "uber jars" while minimizing the number of times external JARs are duplicated across the project.
Here's an example script that builds the code, tests the code, and then creates deployable JARs (taken from our nightly Bamboo build):
# (set PROJ_HOME)
cd $PROJ_HOME/Aleph2
$M2_HOME/bin/mvn clean install -f dependency_pom.xml -DskipTests=true
cd $PROJ_HOME/Aleph2-contrib
$M2_HOME/bin/mvn clean install -Dmaven.test.skip=true
cd $PROJ_HOME/Aleph2
$M2_HOME/bin/mvn clean install -Dmaven.test.skip=true
export VERSION="2.0.$(date +%y%j%H)"
export RELEASETYPE="nightly"
export M2_HOME=/opt/maven-3.0/
# Build
cd $PROJ_HOME/Aleph2
$M2_HOME/bin/mvn clean install -f dependency_pom.xml -DskipTests=true -Daleph2.version=${VERSION}-${RELEASETYPE}
cd $PROJ_HOME/Aleph2-contrib
$M2_HOME/bin/mvn clean install -Dmaven.test.skip=true -Daleph2.version=${VERSION}-${RELEASETYPE}
$M2_HOME/bin/mvn clean package -Dmaven.test.skip=true -Daleph2.version=${VERSION}-${RELEASETYPE} -Daleph2.scope=provided
cd $PROJ_HOME/Aleph2
$M2_HOME/bin/mvn clean install -Dmaven.test.skip=true -Daleph2.version=${VERSION}-${RELEASETYPE}
$M2_HOME/bin/mvn clean package -Dmaven.test.skip=true -Daleph2.version=${VERSION}-${RELEASETYPE} -Daleph2.scope=provided
# Bundle
cd $PROJ_HOME/
mkdir dist
find Aleph2 -name "*-shaded.jar" -exec mv '{}' dist/ \;
find Aleph2-contrib -name "*-shaded.jar" -exec mv '{}' dist/ \;
tar czvf aleph2_alljars-${VERSION}-${RELEASETYPE}-shaded.tgz dist/