Useful Developer Tools

Developing zeppelin-web

Check zeppelin-web: Local Development.


SVM: Scala Version Manager

svm would be useful when changing scala version frequently.

JDK change script: OSX

this script would be helpful when changing JDK version frequently.

function setjdk() {
  if [ $# -ne 0 ]; then
  # written based on OSX. 
  # use diffrent base path for other OS
  removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
  if [ -n "${JAVA_HOME+x}" ]; then
    removeFromPath $JAVA_HOME
  export JAVA_HOME=`/usr/libexec/java_home -v $@`
  export PATH=$JAVA_HOME/bin:$PATH
function removeFromPath() {
  export PATH=$(echo $PATH | sed -E -e "s;:$1;;" -e "s;$1:?;;")

you can use this function like setjdk 1.8 / setjdk 1.7

Building Submodules Selectively

# build `zeppelin-web` only
./mvnw clean -pl 'zeppelin-web' package -DskipTests;

# build `zeppelin-server` and its dependencies only
./mvnw clean package -pl 'spark,spark-dependencies,python,markdown,zeppelin-server' --am -DskipTests

# build spark related modules with default profiles
./mvnw clean package -pl 'spark,spark-dependencies,zeppelin-server' --am -DskipTests

# build spark related modules with profiles: scala 2.13, spark 3.5 hadoop 3.3
./mvnw clean package -Pspark-scala-2.13 -Pspark-3.5 -Phadoop-3.3 \
-pl 'spark,spark-dependencies,zeppelin-server' --am -DskipTests

# build `zeppelin-server` and `markdown` with dependencies
./mvnw clean package -pl 'markdown,zeppelin-server' --am -DskipTests

Running Individual Tests

# run the `HeliumBundleFactoryTest` test class
./mvnw test -pl 'zeppelin-server' --am -DfailIfNoTests=false -Dtest=HeliumBundleFactoryTest

Running Selenium Tests

Make sure that Zeppelin instance is started to execute integration tests (= selenium tests).

# run the `SparkParagraphIT` test class
TEST_SELENIUM="true" ./mvnw test -pl 'zeppelin-server' --am \
-DfailIfNoTests=false -Dtest=SparkParagraphIT

# run the `testSqlSpark` test function only in the `SparkParagraphIT` class
# but note that, some test might be dependent on the previous tests
TEST_SELENIUM="true" ./mvnw test -pl 'zeppelin-server' --am \
-DfailIfNoTests=false -Dtest=SparkParagraphIT#testSqlSpark