Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.6 a7ffc6d02 -> 0f72c90a7


[ZEPPELIN-986] Create publish release script

### What is this PR for?
This PR is to automate release publish to maven repository.
We used to use maven-deploy-plugin and maven-release-plugin for release but 
somehow it didn't work well with Zeppelin so 0.5.5 and 0.5.6 haven't been 
published to maven repository.

Publishing release to maven repository will eventually help zeppelin to reduce 
binary package size by leading users to use Dynamic interpreter loading(#908).
Originally below modules were skipped for maven release
 - all interpreters(except spark)
 - zeppelin-display
 - zeppelin-server
 - zeppelin-distribution

on the other hand this pr will skip only:
 - zeppelin-distribution

### What type of PR is it?
Infra

### Todos
- [x] Include SparkR/R interpreter in release
- [x] Create common_release.sh to remove build configuration duplication
- [x] Check curl networking failure

### What is the Jira issue?
[ZEPPELIN-986](https://issues.apache.org/jira/browse/ZEPPELIN-986)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? Yes, 
https://cwiki.apache.org/confluence/display/ZEPPELIN/Preparing+Zeppelin+Release 
will be updated accordingly once this pr is merged.

Author: Mina Lee <[email protected]>

Closes #994 from minahlee/ZEPPELIN-986 and squashes the following commits:

b0e8e67 [Mina Lee] Revert "Add geode, scalding profile in maven artifact build"
cd4cbcd [Mina Lee] curl failure check
c0ea07c [Mina Lee] Fix wrong indentation
a88bc1d [Mina Lee] Add geode, scalding profile in maven artifact build
2cced61 [Mina Lee] Add r to binary package and maven build
903bc12 [Mina Lee] Move duplicate code to common_release.sh
a3eb676 [Mina Lee] Include zeppelin-server module in publish artifiact
48d338f [Mina Lee] Rollback mistakenly removed plugin
aafaf42 [Mina Lee] Follow google shell  style guide
30dcc65 [Mina Lee] remove deploy plugin from pom since custom script will be 
used instead for deploy
cd1f08c [Mina Lee] Refactor create release script
e764f5f [Mina Lee] Add maven publish release script

(cherry picked from commit 85d70579f54a56d759956542b22a8d84f6a4b9e3)
Signed-off-by: Mina Lee <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/0f72c90a
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/0f72c90a
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/0f72c90a

Branch: refs/heads/branch-0.6
Commit: 0f72c90a7105a2074412a94e3f8df356c82aaa29
Parents: a7ffc6d
Author: Mina Lee <[email protected]>
Authored: Mon Jun 20 10:26:20 2016 -0700
Committer: Mina Lee <[email protected]>
Committed: Wed Jun 22 21:22:21 2016 -0700

----------------------------------------------------------------------
 alluxio/pom.xml               |   9 --
 angular/pom.xml               |   9 --
 cassandra/pom.xml             |   9 --
 dev/common_release.sh         |  61 ++++++++++++++
 dev/create_release.sh         | 165 ++++++++++++++++---------------------
 dev/publish_release.sh        | 138 +++++++++++++++++++++++++++++++
 elasticsearch/pom.xml         |   9 --
 file/pom.xml                  |   9 --
 flink/pom.xml                 |   9 --
 geode/pom.xml                 |   9 --
 hbase/pom.xml                 |   9 --
 ignite/pom.xml                |   9 --
 jdbc/pom.xml                  |   9 --
 kylin/pom.xml                 |   9 --
 lens/pom.xml                  |   9 --
 livy/pom.xml                  |   9 --
 markdown/pom.xml              |   9 --
 pom.xml                       |  47 +++++++----
 postgresql/pom.xml            |   9 --
 python/pom.xml                |   9 --
 r/pom.xml                     |   9 --
 scalding/pom.xml              |   9 --
 shell/pom.xml                 |   9 --
 spark-dependencies/pom.xml    |   9 --
 zeppelin-display/pom.xml      |   9 --
 zeppelin-distribution/pom.xml |  11 ---
 zeppelin-server/pom.xml       |   9 --
 27 files changed, 300 insertions(+), 320 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/alluxio/pom.xml
----------------------------------------------------------------------
diff --git a/alluxio/pom.xml b/alluxio/pom.xml
index fa5df77..bee0091 100644
--- a/alluxio/pom.xml
+++ b/alluxio/pom.xml
@@ -133,15 +133,6 @@
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <version>2.7</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-
-            <plugin>
                 <artifactId>maven-enforcer-plugin</artifactId>
                 <version>1.3.1</version>
                 <executions>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/angular/pom.xml
----------------------------------------------------------------------
diff --git a/angular/pom.xml b/angular/pom.xml
index 9e732b0..b6251f1 100644
--- a/angular/pom.xml
+++ b/angular/pom.xml
@@ -61,15 +61,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>            
         <executions> 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/cassandra/pom.xml
----------------------------------------------------------------------
diff --git a/cassandra/pom.xml b/cassandra/pom.xml
index 46d2530..df00522 100644
--- a/cassandra/pom.xml
+++ b/cassandra/pom.xml
@@ -231,15 +231,6 @@
             </plugin>
 
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <version>2.7</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-
-            <plugin>
                 <artifactId>maven-enforcer-plugin</artifactId>
                 <version>1.3.1</version>
                 <executions>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/dev/common_release.sh
----------------------------------------------------------------------
diff --git a/dev/common_release.sh b/dev/common_release.sh
new file mode 100644
index 0000000..df9c33d
--- /dev/null
+++ b/dev/common_release.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# common fucntions
+
+if [[ -z "${TAR}" ]]; then
+  TAR="/usr/bin/tar"
+fi
+
+if [[ -z "${SHASUM}" ]]; then
+  SHASUM="/usr/bin/shasum"
+fi
+
+if [[ -z "${WORKING_DIR}" ]]; then
+  WORKING_DIR="/tmp/zeppelin-release"
+fi
+
+mkdir "${WORKING_DIR}"
+
+usage() {
+  echo "usage) $0 [Release version] [Branch or Tag]"
+  echo "   ex. $0 0.6.0 v0.6.0"
+  exit 1
+}
+
+function git_clone() { 
+  echo "Clone the source"
+  # clone source
+  git clone https://git-wip-us.apache.org/repos/asf/zeppelin.git 
"${WORKING_DIR}/zeppelin"
+
+  if [[ $? -ne 0 ]]; then
+    echo "Can not clone source repository"
+    exit 1
+  fi
+
+  cd "${WORKING_DIR}/zeppelin"
+  git checkout "${GIT_TAG}"
+  echo "Checked out ${GIT_TAG}"
+
+  # remove unnecessary files
+  rm "${WORKING_DIR}/zeppelin/.gitignore"
+  rm -rf "${WORKING_DIR}/zeppelin/.git"
+  rm -rf "${WORKING_DIR}/zeppelin/.github"
+  rm -rf "${WORKING_DIR}/zeppelin/docs"
+}

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/dev/create_release.sh
----------------------------------------------------------------------
diff --git a/dev/create_release.sh b/dev/create_release.sh
index b37fd51..f1bba0d 100755
--- a/dev/create_release.sh
+++ b/dev/create_release.sh
@@ -18,114 +18,93 @@
 #
 
 # The script helps making a release.
-# You need specify a release name and branch|tag name.
+# You need to specify release version and branch|tag name.
 #
-# Here's some helpful documents for the release
+# Here are some helpful documents for the release.
 # http://www.apache.org/dev/release.html
 # http://www.apache.org/dev/release-publishing
 # http://www.apache.org/dev/release-signing.html
-# http://www.apache.org/dev/publishing-maven-artifacts.html
-
-if [[ -z "${TAR}" ]]; then
-    TAR=/usr/bin/tar
-fi
-
-if [[ -z "${SHASUM}" ]]; then
-    SHASUM="/usr/bin/shasum -a 512"
-fi
-
-
-if [[ -z "${WORKING_DIR}" ]]; then
-    WORKING_DIR=/tmp/zeppelin-release
-fi
-
-if [[ -z "${GPG_PASSPHRASE}" ]]; then
-    echo "You need GPG_PASSPHRASE variable set"
-    exit 1
-fi
 
+BASEDIR="$(dirname "$0")"
+. "${BASEDIR}/common_release.sh"
+echo "${BASEDIR}/common_release.sh"
 
 if [[ $# -ne 2 ]]; then
-    echo "usage) $0 [Release name] [Branch or Tag]"
-    echo "   ex. $0 0.6.0 branch-0.6"
-    exit 1
+  usage
 fi
 
-RELEASE_NAME="${1}"
-BRANCH="${2}"
-
-
-if [[ -d "${WORKING_DIR}" ]]; then
-    echo "Dir ${WORKING_DIR} already exists"
-    exit 1
-fi
-
-mkdir ${WORKING_DIR}
-
-echo "Cloning the source and packaging"
-# clone source
-git clone -b ${BRANCH} [email protected]:apache/zeppelin.git 
${WORKING_DIR}/zeppelin
-if [[ $? -ne 0 ]]; then
-    echo "Can not clone source repository"
-    exit 1
+if [[ -z "${GPG_PASSPHRASE}" ]]; then
+  echo "You need GPG_PASSPHRASE variable set"
+  exit 1
 fi
 
-# remove unnecessary files
-rm ${WORKING_DIR}/zeppelin/.gitignore
-rm -rf ${WORKING_DIR}/zeppelin/.git
-
-
-
-# create source package
-cd ${WORKING_DIR}
-cp -r zeppelin zeppelin-${RELEASE_NAME}
-${TAR} cvzf zeppelin-${RELEASE_NAME}.tgz zeppelin-${RELEASE_NAME}
-
-echo "Signing the source package"
-cd ${WORKING_DIR}
-echo $GPG_PASSPHRASE | gpg --passphrase-fd 0 --armor --output 
zeppelin-${RELEASE_NAME}.tgz.asc --detach-sig 
${WORKING_DIR}/zeppelin-${RELEASE_NAME}.tgz
-echo $GPG_PASSPHRASE | gpg --passphrase-fd 0 --print-md MD5 
zeppelin-${RELEASE_NAME}.tgz > ${WORKING_DIR}/zeppelin-${RELEASE_NAME}.tgz.md5
-${SHASUM} zeppelin-${RELEASE_NAME}.tgz > 
${WORKING_DIR}/zeppelin-${RELEASE_NAME}.tgz.sha512
-
+RELEASE_VERSION="$1"
+GIT_TAG="$2"
+
+function make_source_package() {
+  # create source package
+  cd ${WORKING_DIR}
+  cp -r "zeppelin" "zeppelin-${RELEASE_VERSION}"
+  ${TAR} cvzf "zeppelin-${RELEASE_VERSION}.tgz" "zeppelin-${RELEASE_VERSION}"
+
+  echo "Signing the source package"
+  cd "${WORKING_DIR}"
+  echo "${GPG_PASSPHRASE}" | gpg --passphrase-fd 0 --armor \
+    --output "zeppelin-${RELEASE_VERSION}.tgz.asc" \
+    --detach-sig "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}.tgz"
+  echo "${GPG_PASSPHRASE}" | gpg --passphrase-fd 0 \
+    --print-md MD5 "zeppelin-${RELEASE_VERSION}.tgz" > \
+    "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}.tgz.md5"
+  echo "${GPG_PASSPHRASE}" | gpg --passphrase-fd 0 \
+    --print-md SHA512 "zeppelin-${RELEASE_VERSION}.tgz" > \
+    "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}.tgz.sha512"
+}
 
 function make_binary_release() {
-    BIN_RELEASE_NAME="${1}"
-    BUILD_FLAGS="${2}"
-
-    cp -r ${WORKING_DIR}/zeppelin 
${WORKING_DIR}/zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}
-    cd ${WORKING_DIR}/zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}
-    echo "mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS}"
-    mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS}
-    if [[ $? -ne 0 ]]; then
-        echo "Build failed. ${BUILD_FLAGS}"
-        exit 1
-    fi
-
-    # re-create package with proper dir name with binary license
-    cd zeppelin-distribution/target/zeppelin-*
-    mv zeppelin-* zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}
-    cat ../../src/bin_license/LICENSE >> 
zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}/LICENSE
-    cat ../../src/bin_license/NOTICE >> 
zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}/NOTICE
-    cp ../../src/bin_license/licenses/* 
zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}/licenses/
-    ${TAR} cvzf zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz 
zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}
-
-    # sign bin package
-    echo $GPG_PASSPHRASE | gpg --passphrase-fd 0 --armor --output 
zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz.asc --detach-sig 
zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz
-    echo $GPG_PASSPHRASE | gpg --passphrase-fd 0 --print-md MD5 
zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz > 
zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz.md5
-    ${SHASUM} zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz > 
zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz.sha512
-
-    mv zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz ${WORKING_DIR}/
-    mv zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz.asc ${WORKING_DIR}/
-    mv zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz.md5 ${WORKING_DIR}/
-    mv zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz.sha512 
${WORKING_DIR}/
-
-    # clean up build dir
-    rm -rf ${WORKING_DIR}/zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}
+  BIN_RELEASE_NAME="$1"
+  BUILD_FLAGS="$2"
+
+  cp -r "${WORKING_DIR}/zeppelin" 
"${WORKING_DIR}/zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}"
+  cd "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}"
+  echo "mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS}"
+  mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS}
+  if [[ $? -ne 0 ]]; then
+    echo "Build failed. ${BUILD_FLAGS}"
+    exit 1
+  fi
+
+  # re-create package with proper dir name with binary license
+  cd zeppelin-distribution/target/zeppelin-*
+  mv zeppelin-* "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}"
+  cat ../../src/bin_license/LICENSE >> 
"zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}/LICENSE"
+  cat ../../src/bin_license/NOTICE >> 
"zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}/NOTICE"
+  cp ../../src/bin_license/licenses/* 
"zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}/licenses/"
+  ${TAR} cvzf "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz" 
"zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}"
+
+  # sign bin package
+  echo "${GPG_PASSPHRASE}" | gpg --passphrase-fd 0 --armor \
+    --output "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz.asc" \
+    --detach-sig "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz"
+  echo "${GPG_PASSPHRASE}" | gpg --passphrase-fd 0 --print-md MD5 \
+    "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz" > \
+    "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz.md5"
+  ${SHASUM} -a 512 "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz" > 
\
+    "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz.sha512"
+
+  mv "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz" 
"${WORKING_DIR}/"
+  mv "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz.asc" 
"${WORKING_DIR}/"
+  mv "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz.md5" 
"${WORKING_DIR}/"
+  mv "zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}.tgz.sha512" 
"${WORKING_DIR}/"
+
+  # clean up build dir
+  rm -rf "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}"
 }
 
-make_binary_release all "-Pspark-1.6 -Phadoop-2.4 -Pyarn -Ppyspark"
+git_clone
+make_source_package
+make_binary_release all "-Pspark-1.6 -Phadoop-2.4 -Pyarn -Ppyspark -Psparkr 
-Pr"
 
 # remove non release files and dirs
-rm -rf ${WORKING_DIR}/zeppelin
-rm -rf ${WORKING_DIR}/zeppelin-${RELEASE_NAME}
+rm -rf "${WORKING_DIR}/zeppelin"
+rm -rf "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}"
 echo "Release files are created under ${WORKING_DIR}"

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/dev/publish_release.sh
----------------------------------------------------------------------
diff --git a/dev/publish_release.sh b/dev/publish_release.sh
new file mode 100755
index 0000000..e5a4419
--- /dev/null
+++ b/dev/publish_release.sh
@@ -0,0 +1,138 @@
+#!/bin/bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# The script helps publishing release to maven.
+# You need to specify release version and branch|tag name.
+#
+# Here's some helpful documents for the release.
+# http://www.apache.org/dev/publishing-maven-artifacts.html
+
+BASEDIR="$(dirname "$0")"
+. "${BASEDIR}/common_release.sh"
+
+if [[ $# -ne 2 ]]; then
+  usage
+fi
+
+for var in GPG_PASSPHRASE ASF_USERID ASF_PASSWORD; do
+  if [[ -z "${!var}" ]]; then
+    echo "You need ${var} variable set"
+    exit 1
+  fi
+done
+
+export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=512m"
+RED='\033[0;31m'
+NC='\033[0m' # No Color
+
+RELEASE_VERSION="$1"
+GIT_TAG="$2"
+
+PUBLISH_PROFILES="-Pspark-1.6 -Phadoop-2.4 -Pyarn -Ppyspark -Psparkr -Pr"
+PROJECT_OPTIONS="-pl !zeppelin-distribution"
+NEXUS_STAGING="https://repository.apache.org/service/local/staging";
+NEXUS_PROFILE="153446d1ac37c4"
+
+function cleanup() {
+  echo "Remove working directory and maven local repository"
+  rm -rf ${WORKING_DIR}
+  rm -rf ${tmp_repo}
+}
+
+function curl_error() {
+  ret=${1}
+  if [[ $ret -ne 0 ]]; then
+    echo "curl response code is: ($ret)"
+    echo "See https://curl.haxx.se/libcurl/c/libcurl-errors.html to know the 
detailed cause of error."
+    echo -e "${RED}Failed to publish maven artifact to staging repository."
+    echo -e "IMPORTANT: You will have to re-run publish_release.sh to complete 
maven artifact publish.${NC}"
+    cleanup
+    exit 1
+  fi
+}
+
+function publish_to_maven() {
+  cd "${WORKING_DIR}/zeppelin"
+
+  # Force release version
+  mvn versions:set -DnewVersion="${RELEASE_VERSION}"
+
+  # Using Nexus API documented here:
+  # 
https://support.sonatype.com/hc/en-us/articles/213465868-Uploading-to-a-Staging-Repository-via-REST-API
+  echo "Creating Nexus staging repository"
+  repo_request="<promoteRequest><data><description>Apache Zeppelin 
${RELEASE_VERSION}</description></data></promoteRequest>"
+  out="$(curl -X POST -d "${repo_request}" -u "${ASF_USERID}:${ASF_PASSWORD}" \
+    -H 'Content-Type:application/xml' -v \
+    "${NEXUS_STAGING}/profiles/${NEXUS_PROFILE}/start")"
+  create_ret=$?
+  curl_error $create_ret
+  staged_repo_id="$(echo "${out}" | sed -e 
's/.*\(orgapachezeppelin-[0-9]\{4\}\).*/\1/')"
+  echo "Created Nexus staging repository: ${staged_repo_id}"
+
+  tmp_repo="$(mktemp -d /tmp/zeppelin-repo-XXXXX)"
+
+  echo "mvn clean install -Ppublish-distr \
+    -Dmaven.repo.local=${tmp_repo} \
+    ${PUBLISH_PROFILES} ${PROJECT_OPTIONS}"
+  mvn clean install -Ppublish-distr -Dmaven.repo.local="${tmp_repo}" \
+    ${PUBLISH_PROFILES} ${PROJECT_OPTIONS}
+  if [[ $? -ne 0 ]]; then
+    echo "Build failed."
+    exit 1
+  fi
+
+  pushd "${tmp_repo}/org/apache/zeppelin"
+  find . -type f | grep -v '\.jar$' | grep -v '\.pom$' |grep -v '\.war$' | 
xargs rm
+
+  echo "Creating hash and signature files"
+  for file in $(find . -type f); do
+    echo "${GPG_PASSPHRASE}" | gpg --passphrase-fd 0 --output "${file}.asc" \
+      --detach-sig --armor "${file}"
+    md5 -q "${file}" > "${file}.md5"
+    ${SHASUM} -a 1 "${file}" | cut -f1 -d' ' > "${file}.sha1"
+  done
+
+  nexus_upload="${NEXUS_STAGING}/deployByRepositoryId/${staged_repo_id}"
+  echo "Uplading files to ${nexus_upload}"
+  for file in $(find . -type f); do
+    # strip leading ./
+    file_short="$(echo "${file}" | sed -e 's/\.\///')"
+    dest_url="${nexus_upload}/org/apache/zeppelin/$file_short"
+    echo "  Uploading ${file_short}"
+    curl -u "${ASF_USERID}:${ASF_PASSWORD}" --upload-file "${file_short}" 
"${dest_url}"
+    upload_ret=$?
+    curl_error $upload_ret
+  done
+
+  echo "Closing nexus staging repository"
+  
repo_request="<promoteRequest><data><stagedRepositoryId>${staged_repo_id}</stagedRepositoryId><description>Apache
 Zeppelin ${RELEASE_VERSION}</description></data></promoteRequest>"
+  out="$(curl -X POST -d "${repo_request}" -u "${ASF_USERID}:${ASF_PASSWORD}" \
+    -H 'Content-Type:application/xml' -v \
+    "${NEXUS_STAGING}}/profiles/${NEXUS_PROFILE}/finish")"
+  close_ret=$?
+  curl_error $close_ret
+  echo "Closed Nexus staging repository: ${staged_repo_id}"
+  popd
+  echo "Complete publishing maven artifacts to apache staging repository"
+  echo "Once release candidate pass the vote, do not forget to hit the release 
button in https://repository.apache.org";
+}
+
+git_clone
+publish_to_maven
+cleanup

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/elasticsearch/pom.xml
----------------------------------------------------------------------
diff --git a/elasticsearch/pom.xml b/elasticsearch/pom.xml
index 7f53299..b26dad6 100644
--- a/elasticsearch/pom.xml
+++ b/elasticsearch/pom.xml
@@ -80,15 +80,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>            
         <executions> 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/file/pom.xml
----------------------------------------------------------------------
diff --git a/file/pom.xml b/file/pom.xml
index 2410432..6eb4a92 100644
--- a/file/pom.xml
+++ b/file/pom.xml
@@ -74,15 +74,6 @@
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>2.18.1</version>
       </plugin>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/flink/pom.xml
----------------------------------------------------------------------
diff --git a/flink/pom.xml b/flink/pom.xml
index 16187a1..7d096a3 100644
--- a/flink/pom.xml
+++ b/flink/pom.xml
@@ -295,15 +295,6 @@
       </plugin>
 
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>
         <executions>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/geode/pom.xml
----------------------------------------------------------------------
diff --git a/geode/pom.xml b/geode/pom.xml
index 961483c..9e49efe 100644
--- a/geode/pom.xml
+++ b/geode/pom.xml
@@ -85,15 +85,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>
         <executions>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/hbase/pom.xml
----------------------------------------------------------------------
diff --git a/hbase/pom.xml b/hbase/pom.xml
index 3b8fcb6..5496025 100644
--- a/hbase/pom.xml
+++ b/hbase/pom.xml
@@ -110,15 +110,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>
         <executions>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/ignite/pom.xml
----------------------------------------------------------------------
diff --git a/ignite/pom.xml b/ignite/pom.xml
index 260ed29..d441c46 100644
--- a/ignite/pom.xml
+++ b/ignite/pom.xml
@@ -108,15 +108,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>            
         <executions> 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/jdbc/pom.xml
----------------------------------------------------------------------
diff --git a/jdbc/pom.xml b/jdbc/pom.xml
index 550f439..aab9e3a 100644
--- a/jdbc/pom.xml
+++ b/jdbc/pom.xml
@@ -103,15 +103,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>
         <executions>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/kylin/pom.xml
----------------------------------------------------------------------
diff --git a/kylin/pom.xml b/kylin/pom.xml
index 34ef235..f962318 100755
--- a/kylin/pom.xml
+++ b/kylin/pom.xml
@@ -62,15 +62,6 @@
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <version>2.7</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-
-            <plugin>
                 <artifactId>maven-enforcer-plugin</artifactId>
                 <version>1.3.1</version>
                 <executions>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/lens/pom.xml
----------------------------------------------------------------------
diff --git a/lens/pom.xml b/lens/pom.xml
index 667475f..1c07eca 100644
--- a/lens/pom.xml
+++ b/lens/pom.xml
@@ -147,15 +147,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>            
         <executions> 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/livy/pom.xml
----------------------------------------------------------------------
diff --git a/livy/pom.xml b/livy/pom.xml
index f739efd..90f149c 100644
--- a/livy/pom.xml
+++ b/livy/pom.xml
@@ -101,15 +101,6 @@
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <version>2.7</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-
-            <plugin>
                 <artifactId>maven-enforcer-plugin</artifactId>
                 <version>1.3.1</version>
                 <executions>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/markdown/pom.xml
----------------------------------------------------------------------
diff --git a/markdown/pom.xml b/markdown/pom.xml
index 1c5e174..506e41f 100644
--- a/markdown/pom.xml
+++ b/markdown/pom.xml
@@ -67,15 +67,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>            
         <executions> 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 805d258..424f220 100755
--- a/pom.xml
+++ b/pom.xml
@@ -371,24 +371,6 @@
       </plugin>
 
       <plugin>
-        <artifactId>maven-javadoc-plugin</artifactId>
-        <version>2.9.1</version>
-        <configuration><!-- Default configuration for all reports -->
-        </configuration>
-        <executions>
-          <execution>
-            <id>aggregate</id>
-            <goals>
-              <goal>aggregate</goal>
-            </goals>
-            <phase>site</phase>
-            <configuration><!-- Specific configuration for the aggregate 
report -->
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-scm-plugin</artifactId>
         <version>1.8.1</version>
         <configuration>
@@ -729,6 +711,7 @@
       <activation>
         <activeByDefault>false</activeByDefault>
       </activation>
+
       <build>
         <plugins>
           <plugin>
@@ -737,6 +720,34 @@
               <skipTests>true</skipTests>
             </configuration>
           </plugin>
+
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-source-plugin</artifactId>
+            <version>3.0.0</version>
+            <executions>
+              <execution>
+                <id>attach-sources</id>
+                <goals>
+                  <goal>jar</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-javadoc-plugin</artifactId>
+            <version>2.10.3</version>
+            <executions>
+              <execution>
+                <id>attach-javadocs</id>
+                <goals>
+                  <goal>jar</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
         </plugins>
       </build>
     </profile>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/postgresql/pom.xml
----------------------------------------------------------------------
diff --git a/postgresql/pom.xml b/postgresql/pom.xml
index f5554fa..641a650 100644
--- a/postgresql/pom.xml
+++ b/postgresql/pom.xml
@@ -96,15 +96,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>
         <executions>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/python/pom.xml
----------------------------------------------------------------------
diff --git a/python/pom.xml b/python/pom.xml
index 8db5fed..b91142e 100644
--- a/python/pom.xml
+++ b/python/pom.xml
@@ -88,15 +88,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>            
         <executions> 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/r/pom.xml
----------------------------------------------------------------------
diff --git a/r/pom.xml b/r/pom.xml
index 0684bb1..a6bec52 100644
--- a/r/pom.xml
+++ b/r/pom.xml
@@ -206,15 +206,6 @@
       </plugin>
 
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>
         <executions>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/scalding/pom.xml
----------------------------------------------------------------------
diff --git a/scalding/pom.xml b/scalding/pom.xml
index a3b3b58..7dbaf76 100644
--- a/scalding/pom.xml
+++ b/scalding/pom.xml
@@ -143,15 +143,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>            
         <executions> 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/shell/pom.xml
----------------------------------------------------------------------
diff --git a/shell/pom.xml b/shell/pom.xml
index 413b4a6..2f73ea6 100644
--- a/shell/pom.xml
+++ b/shell/pom.xml
@@ -67,15 +67,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>            
         <executions> 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/spark-dependencies/pom.xml
----------------------------------------------------------------------
diff --git a/spark-dependencies/pom.xml b/spark-dependencies/pom.xml
index 143e9cc..556f563 100644
--- a/spark-dependencies/pom.xml
+++ b/spark-dependencies/pom.xml
@@ -971,15 +971,6 @@
       </plugin>
 
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.3.1</version>
         <executions>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/zeppelin-display/pom.xml
----------------------------------------------------------------------
diff --git a/zeppelin-display/pom.xml b/zeppelin-display/pom.xml
index e648d6a..b112b8b 100644
--- a/zeppelin-display/pom.xml
+++ b/zeppelin-display/pom.xml
@@ -133,15 +133,6 @@
       </plugin>
 
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <groupId>org.scala-tools</groupId>
         <artifactId>maven-scala-plugin</artifactId>
         <version>2.15.2</version>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/zeppelin-distribution/pom.xml
----------------------------------------------------------------------
diff --git a/zeppelin-distribution/pom.xml b/zeppelin-distribution/pom.xml
index d7beb49..32b05d6 100644
--- a/zeppelin-distribution/pom.xml
+++ b/zeppelin-distribution/pom.xml
@@ -80,18 +80,7 @@
           <skip>true</skip>
         </configuration>
       </plugin>
-
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
     </plugins>
-
   </build>
 
   <profiles>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0f72c90a/zeppelin-server/pom.xml
----------------------------------------------------------------------
diff --git a/zeppelin-server/pom.xml b/zeppelin-server/pom.xml
index 675a2ce..270eb58 100644
--- a/zeppelin-server/pom.xml
+++ b/zeppelin-server/pom.xml
@@ -328,15 +328,6 @@
       </plugin>
 
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <version>2.7</version>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <groupId>org.scala-tools</groupId>
         <artifactId>maven-scala-plugin</artifactId>
         <version>2.15.2</version>

Reply via email to