You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by st...@apache.org on 2021/01/15 04:35:40 UTC

[phoenix] branch master updated: PHOENIX-6307 Build and release official binary distributions with each HBase profile

This is an automated email from the ASF dual-hosted git repository.

stoty pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/master by this push:
     new c2fbab1  PHOENIX-6307 Build and release official binary distributions with each HBase profile
c2fbab1 is described below

commit c2fbab1715dc41c78debb175ce9ecd2089ca0ff5
Author: Istvan Toth <st...@apache.org>
AuthorDate: Mon Jan 11 09:33:40 2021 +0100

    PHOENIX-6307 Build and release official binary distributions with each HBase profile
---
 BUILDING.md                                        |   4 +-
 bin/phoenix_utils.py                               |  24 +----
 .../cache-apache-project-artifact.sh               |   1 +
 dev/create-release/do-release-docker.sh            |   1 -
 dev/create-release/rebuild_hbase.sh                |   1 +
 dev/create-release/release-build.sh                |   8 +-
 dev/create-release/release-util.sh                 | 115 ++++++++++++++-------
 dev/rebuild_hbase.sh                               |   6 +-
 phoenix-assembly/pom.xml                           |  26 ++---
 .../build/components/all-common-dependencies.xml   |   9 --
 .../src/build/components/all-common-jars.xml       |   4 +-
 .../phoenix-client-embedded/pom.xml                |   7 +-
 phoenix-client-parent/phoenix-client/pom.xml       |   7 +-
 phoenix-core/pom.xml                               |  15 +++
 phoenix-server/pom.xml                             |  22 +++-
 pom.xml                                            |  69 ++++++++++---
 16 files changed, 192 insertions(+), 127 deletions(-)

diff --git a/BUILDING.md b/BUILDING.md
index 9433aed..707b467 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -71,7 +71,7 @@ As Phoenix uses *limited public* HBase APIs, which sometimes change even within
 Phoenix may not build or work with older releases of HBase, or ones that were released after
 Phoenix, even within the same HBase minor release.
 
-By default, Phoenix will be built for the latest known patch level of the earliest HBase 2.x
+By default, Phoenix will be built for the latest known patch level of the latest HBase 2.x
 minor release that Phoenix supports.
 
 You can specify the targeted HBase minor release by setting the `hbase.profile` system property for 
@@ -80,7 +80,7 @@ maven.
 You can also specify the exact HBase release to build Phoenix with by additionally
 setting the `hbase.version` system property.
 
- * `mvn clean install` will use the latest known patch release of the the earliest supported HBase 2 minor relese
+ * `mvn clean install` will use the latest known patch release of the the latest supported HBase 2 minor relese
  * `mvn clean install -Dhbase.profile=2.1` will use the latest known patch release of HBase 2.1
  * `mvn clean install -Dhbase.profile=2.1 -Dhbase.version=2.1.7` will build with HBase 2.1.7
 
diff --git a/bin/phoenix_utils.py b/bin/phoenix_utils.py
index cf675d0..84f228d 100755
--- a/bin/phoenix_utils.py
+++ b/bin/phoenix_utils.py
@@ -77,10 +77,7 @@ def findClasspath(command_name):
     return tryDecode(subprocess.Popen(command, shell=True, stdout=subprocess.PIPE).stdout.read())
 
 def setPath():
-    PHOENIX_CLIENT_JAR_PATTERN = "phoenix-client*[!s].jar"
-    PHOENIX_THIN_CLIENT_JAR_PATTERN = "phoenix-*-thin-client.jar"
-    PHOENIX_QUERYSERVER_JAR_PATTERN = "phoenix-*-queryserver.jar"
-    PHOENIX_LOADBALANCER_JAR_PATTERN = "phoenix-load-balancer-*[!t][!e][!s][!t][!s].jar"
+    PHOENIX_CLIENT_JAR_PATTERN = "phoenix-client-hbase-*[!s].jar"
     PHOENIX_TRACESERVER_JAR_PATTERN = "phoenix-tracing-webapp-*-runnable.jar"
     PHOENIX_TESTS_JAR_PATTERN = "phoenix-core-*-tests*.jar"
     PHOENIX_PHERF_JAR_PATTERN = "phoenix-pherf-*-minimal*.jar"
@@ -165,20 +162,6 @@ def setPath():
     if testjar == "":
         testjar = find(PHOENIX_TESTS_JAR_PATTERN, phoenix_class_path)
 
-    global phoenix_queryserver_jar
-    phoenix_queryserver_jar = find(PHOENIX_QUERYSERVER_JAR_PATTERN, os.path.join(current_dir, "..", "phoenix-queryserver", "target", "*"))
-    if phoenix_queryserver_jar == "":
-        phoenix_queryserver_jar = findFileInPathWithoutRecursion(PHOENIX_QUERYSERVER_JAR_PATTERN, os.path.join(current_dir, "..", "lib"))
-    if phoenix_queryserver_jar == "":
-        phoenix_queryserver_jar = findFileInPathWithoutRecursion(PHOENIX_QUERYSERVER_JAR_PATTERN, os.path.join(current_dir, ".."))
-
-    global phoenix_loadbalancer_jar
-    phoenix_loadbalancer_jar = find(PHOENIX_LOADBALANCER_JAR_PATTERN, os.path.join(current_dir, "..", "phoenix-loadbalancer", "target", "*"))
-    if phoenix_loadbalancer_jar == "":
-        phoenix_loadbalancer_jar = findFileInPathWithoutRecursion(PHOENIX_LOADBALANCER_JAR_PATTERN, os.path.join(current_dir, "..", "lib"))
-    if phoenix_loadbalancer_jar == "":
-        phoenix_loadbalancer_jar = findFileInPathWithoutRecursion(PHOENIX_LOADBALANCER_JAR_PATTERN, os.path.join(current_dir, ".."))
-
     global phoenix_traceserver_jar
     phoenix_traceserver_jar = find(PHOENIX_TRACESERVER_JAR_PATTERN, os.path.join(current_dir, "..", "phoenix-tracing-webapp", "target", "*"))
     if phoenix_traceserver_jar == "":
@@ -193,11 +176,6 @@ def setPath():
     if phoenix_pherf_jar == "":
         phoenix_pherf_jar = findFileInPathWithoutRecursion(PHOENIX_PHERF_JAR_PATTERN, os.path.join(current_dir, ".."))
 
-    global phoenix_thin_client_jar
-    phoenix_thin_client_jar = find(PHOENIX_THIN_CLIENT_JAR_PATTERN, os.path.join(current_dir, "..", "phoenix-queryserver-client", "target", "*"))
-    if phoenix_thin_client_jar == "":
-        phoenix_thin_client_jar = findFileInPathWithoutRecursion(PHOENIX_THIN_CLIENT_JAR_PATTERN, os.path.join(current_dir, ".."))
-
     return ""
 
 def shell_quote(args):
diff --git a/dev/create-release/cache-apache-project-artifact.sh b/dev/create-release/cache-apache-project-artifact.sh
new file mode 120000
index 0000000..d9e4e02
--- /dev/null
+++ b/dev/create-release/cache-apache-project-artifact.sh
@@ -0,0 +1 @@
+../cache-apache-project-artifact.sh
\ No newline at end of file
diff --git a/dev/create-release/do-release-docker.sh b/dev/create-release/do-release-docker.sh
index 4535611..8d201e8 100755
--- a/dev/create-release/do-release-docker.sh
+++ b/dev/create-release/do-release-docker.sh
@@ -212,7 +212,6 @@ DRY_RUN=$DRY_RUN
 SKIP_TAG=$SKIP_TAG
 RUNNING_IN_DOCKER=1
 GIT_BRANCH=$GIT_BRANCH
-NEXT_VERSION=$NEXT_VERSION
 RELEASE_VERSION=$RELEASE_VERSION
 RELEASE_TAG=$RELEASE_TAG
 GIT_REF=$GIT_REF
diff --git a/dev/create-release/rebuild_hbase.sh b/dev/create-release/rebuild_hbase.sh
new file mode 120000
index 0000000..53a5e6e
--- /dev/null
+++ b/dev/create-release/rebuild_hbase.sh
@@ -0,0 +1 @@
+../rebuild_hbase.sh
\ No newline at end of file
diff --git a/dev/create-release/release-build.sh b/dev/create-release/release-build.sh
index 95dc618..1d609c8 100755
--- a/dev/create-release/release-build.sh
+++ b/dev/create-release/release-build.sh
@@ -59,7 +59,6 @@ Used only for 'tag':
   GIT_NAME - Name to use with git
   GIT_EMAIL - E-mail address to use with git
   GIT_BRANCH - Git branch on which to make release. Tag is always placed at HEAD of this branch.
-  NEXT_VERSION - Development version after release (e.g. 2.1.3-SNAPSHOT)
 
 Used only for 'publish':
   GIT_REF - Release tag or commit to build from (defaults to $RELEASE_TAG; only need to
@@ -113,7 +112,7 @@ if [[ "$1" == "tag" ]]; then
   # for 'tag' stage
   set -o pipefail
   check_get_passwords ASF_PASSWORD
-  check_needed_vars PROJECT RELEASE_VERSION RELEASE_TAG NEXT_VERSION GIT_EMAIL GIT_NAME GIT_BRANCH
+  check_needed_vars PROJECT RELEASE_VERSION RELEASE_TAG GIT_EMAIL GIT_NAME GIT_BRANCH
   if [ -z "${GIT_REPO}" ]; then
     check_needed_vars ASF_USERNAME ASF_PASSWORD
   fi
@@ -147,11 +146,6 @@ if [[ "$1" == "tag" ]]; then
   echo "Creating tag $RELEASE_TAG at the head of $GIT_BRANCH"
   git tag "$RELEASE_TAG"
 
-  # Create next version
-  maven_set_version "$NEXT_VERSION"
-
-  git commit -a -m "Preparing development version $NEXT_VERSION"
-
   if ! is_dry_run; then
     # Push changes
     git push origin "$RELEASE_TAG"
diff --git a/dev/create-release/release-util.sh b/dev/create-release/release-util.sh
index 8f575b4..7ac8375 100755
--- a/dev/create-release/release-util.sh
+++ b/dev/create-release/release-util.sh
@@ -152,7 +152,6 @@ function get_release_info {
     parse_version)"
   echo "Current branch VERSION is $version."
 
-  NEXT_VERSION="$version"
   RELEASE_VERSION=""
   SHORT_VERSION="$(echo "$version" | cut -d . -f 1-2)"
   if [[ ! "$version" =~ .*-SNAPSHOT ]]; then
@@ -176,7 +175,6 @@ function get_release_info {
     if git ls-remote --tags "$ASF_REPO" "$PREV_REL_TAG" | grep -q "refs/tags/${PREV_REL_TAG}$" ; then
       RC_COUNT=0
       REV=$((REV + 1))
-      NEXT_VERSION="${SHORT_VERSION}.${REV}-SNAPSHOT"
     else
       RELEASE_VERSION="${SHORT_VERSION}.${PREV_REL_REV}"
       RC_COUNT="$(git ls-remote --tags "$ASF_REPO" "${RELEASE_VERSION}RC*" | wc -l)"
@@ -185,13 +183,11 @@ function get_release_info {
     fi
   else
     REV=$((REV + 1))
-    NEXT_VERSION="${SHORT_VERSION}.${REV}-SNAPSHOT"
     RC_COUNT=0
   fi
 
   RELEASE_VERSION="$(read_config "RELEASE_VERSION" "$RELEASE_VERSION")"
-  NEXT_VERSION="$(read_config "NEXT_VERSION" "$NEXT_VERSION")"
-  export RELEASE_VERSION NEXT_VERSION
+  export RELEASE_VERSION
 
   RC_COUNT="$(read_config "RC_COUNT" "$RC_COUNT")"
   RELEASE_TAG="${RELEASE_VERSION}RC${RC_COUNT}"
@@ -244,7 +240,6 @@ function get_release_info {
 Release details:
 GIT_BRANCH:      $GIT_BRANCH
 RELEASE_VERSION: $RELEASE_VERSION
-NEXT_VERSION:    $NEXT_VERSION
 RELEASE_TAG:     $RELEASE_TAG $([[ "$GIT_REF" != "$RELEASE_TAG" ]] && printf "\n%s\n" "GIT_REF:         $GIT_REF")
 API_DIFF_TAG:    $API_DIFF_TAG
 ASF_USERNAME:    $ASF_USERNAME
@@ -586,37 +581,45 @@ make_src_release() {
 make_binary_release() {
   local project="${1}"
   local version="${2}"
-  local base_name="${project}-${version}"
   local timing_token
   timing_token="$(start_step)"
-  rm -rf "${base_name}"-bin*
-  cd "$project" || exit
 
-  git clean -d -f -x
-  # Three invocations of maven. This seems to work. One to
-  # populate the repo, another to build the site, and then
-  # a third to assemble the binary artifact. Trying to do
-  # all in the one invocation fails; a problem in our
-  # assembly spec to in maven. TODO. Meantime, three invocations.
-  #"${MVN[@]}" clean install -DskipTests
-  #"${MVN[@]}" site -DskipTests
-  kick_gpg_agent
-  "${MVN[@]}" clean package -DskipTests -Dcheckstyle.skip=true "${PUBLISH_PROFILES[@]}"
-
-  # Check there is a bin gz output. The build may not produce one: e.g. hbase-thirdparty.
-  local f_bin_prefix="./${PROJECT}-assembly/target/${base_name}"
-  if ls "${f_bin_prefix}"*-bin.tar.gz &>/dev/null; then
-    cp "${f_bin_prefix}"*-bin.tar.gz ..
-    cd .. || exit
-    for i in "${base_name}"*-bin.tar.gz; do
-      "${GPG}" "${GPG_ARGS[@]}" --armour --output "${i}.asc" --detach-sig "${i}"
-      "${GPG}" "${GPG_ARGS[@]}" --print-md SHA512 "${i}" > "${i}.sha512"
-    done
+  cd "$project" || exit
+  if [[ "$project" == "phoenix" ]]; then
+    rebuild_hbase_2
+    local profiles=( $(maven_get_hbase_profiles) )
   else
-    cd .. || exit
-    echo "No ${f_bin_prefix}*-bin.tar.gz product; expected?"
+    local profiles=( "" )
   fi
 
+  for profile in "${profiles[@]}"; do
+    if [ -z $profile ]; then
+      local hbase_suffix=""
+    else
+      local hbase_suffix="-hbase-${profile}"
+    fi
+    local base_name="${project}${hbase_suffix}-${version}"
+    rm -rf ../"${base_name}"-bin*
+
+    git clean -d -f -x
+    kick_gpg_agent
+    "${MVN[@]}" clean package -DskipTests -Dcheckstyle.skip=true "${PUBLISH_PROFILES[@]}" "-Dhbase.profile=${profile}"
+
+    # Check there is a bin gz output. The build may not produce one: e.g. hbase-thirdparty.
+    local f_bin_prefix="./${PROJECT}-assembly/target/${base_name}"
+    if ls "${f_bin_prefix}"*-bin.tar.gz &>/dev/null; then
+      cp "${f_bin_prefix}"*-bin.tar.gz ..
+      cd .. || exit
+      for i in "${base_name}"*-bin.tar.gz; do
+        "${GPG}" "${GPG_ARGS[@]}" --armour --output "${i}.asc" --detach-sig "${i}"
+        "${GPG}" "${GPG_ARGS[@]}" --print-md SHA512 "${i}" > "${i}.sha512"
+      done
+      cd "$project" || exit
+    else
+      echo "No ${f_bin_prefix}*-bin.tar.gz product; expected?"
+    fi
+  done
+  cd .. || exit
   stop_step "${timing_token}"
 }
 
@@ -643,12 +646,6 @@ function maven_set_version { #input: <version_to_set>
   fi
   echo "${MVN[@]}" ${variant:+"$variant"} versions:set -DnewVersion="$this_version"
   "${MVN[@]}" ${variant:+"$variant"} versions:set -DnewVersion="$this_version" | grep -v "no value" # silence logs
-  #Hacking around nonstandard maven submodules for phoenix only
-  for i in phoenix-hbase-compat-*; do
-    if [ -e "$i" ]; then
-     "${MVN[@]}" ${variant:+"$variant"} -pl $i versions:set -DnewVersion="$this_version" | grep -v "no value" # silence logs
-    fi
-  done
   #Omid has an even more nonstandard maven structure, and needs more hacks
   for i in hbase-shims/hbase-*; do
     if [ -e "$i" ]; then
@@ -663,6 +660,17 @@ function maven_get_version {
   "${MVN[@]}" -q -N -Dexec.executable="echo" -Dexec.args='${project.version}' exec:exec
 }
 
+function maven_get_hbase_profiles {
+  # shellcheck disable=SC2016
+  "${MVN[@]}" -q -N -Dexec.executable="echo" -Dexec.args='${hbase.profile.list}' exec:exec
+}
+
+function maven_get_hbase_version_from_profile {
+  # shellcheck disable=SC2016
+  local profile="$1"
+  "${MVN[@]}" -q -N -Dexec.executable="echo" -Dexec.args='${hbase-'"$profile"'.runtime.version}' exec:exec
+}
+
 # Do maven deploy to snapshot or release artifact repository, with checks.
 function maven_deploy { #inputs: <snapshot|release> <log_file_path>
   local timing_token
@@ -688,8 +696,7 @@ function maven_deploy { #inputs: <snapshot|release> <log_file_path>
   echo "Publish version is $RELEASE_VERSION"
   # Coerce the requested version
   maven_set_version "$RELEASE_VERSION"
-  # Prepare for signing
-  kick_gpg_agent
+
   declare -a mvn_goals=(clean install)
   if ! is_dry_run; then
     mvn_goals=("${mvn_goals[@]}" deploy)
@@ -697,14 +704,23 @@ function maven_deploy { #inputs: <snapshot|release> <log_file_path>
   # Omid needs to be deployed twice for HBase 1 and 2
   if [[ "$PROJECT" == "phoenix-omid" ]]; then
     local variants=( "${OMID_VARIANTS[@]}" )
+  elif [[ "$PROJECT" == "phoenix" ]]; then
+    rebuild_hbase_2
+    local profiles=( $(maven_get_hbase_profiles) )
+    local variants=()
+    for i in "${profiles[@]}"; do
+      variants+=("-Dhbase.profile=$i")
+    done
   else
     local variants=( "" )
   fi
+  rm -f "$mvn_log_file"
   for variant in "${variants[@]}"; do
     echo "${MVN[@]}" -DskipTests -Dcheckstyle.skip=true "${PUBLISH_PROFILES[@]}" ${variant:+"$variant"} \
         "${mvn_goals[@]}"
     echo "Logging to ${mvn_log_file}.  This will take a while..."
-    rm -f "$mvn_log_file"
+    # Prepare for signing
+    kick_gpg_agent
     # The tortuous redirect in the next command allows mvn's stdout and stderr to go to mvn_log_file,
     # while also sending stderr back to the caller.
     # shellcheck disable=SC2094
@@ -724,3 +740,22 @@ function maven_deploy { #inputs: <snapshot|release> <log_file_path>
 function get_host_os() {
   uname -s | tr '[:lower:]' '[:upper:]'
 }
+
+function rebuild_hbase_2() {
+  if [[ "yes" == "$HBASE_ALREADY_REBUILT" ]]; then
+     return 0
+  fi
+  local profiles=( $(maven_get_hbase_profiles) )
+  for i in "${profiles[@]}"; do
+    local hbase_runtime_version=$(maven_get_hbase_version_from_profile "$i")
+    if [[ $hbase_runtime_version == 2* ]]; then
+      rebuild_hbase_locally "$hbase_runtime_version"
+    fi
+  done
+  HBASE_ALREADY_REBUILT="yes"
+}
+
+function rebuild_hbase_locally() {
+  local hbase_version="$1"
+  MAVEN_SETTINGS_FILE="$MAVEN_SETTINGS_FILE" "$SELF"/rebuild_hbase.sh "$hbase_version"
+}
\ No newline at end of file
diff --git a/dev/rebuild_hbase.sh b/dev/rebuild_hbase.sh
index 2e7bc40..f630ab4 100755
--- a/dev/rebuild_hbase.sh
+++ b/dev/rebuild_hbase.sh
@@ -48,7 +48,7 @@ HBASE_SOURCE_MIRROR_NAME="hbase/$HBASE_VERSION/$HBASE_SOURCE_NAME"
 
 if [ $# -ne 1 ]
   then
-    echo "Supply the Hbase version as paramater i.e.: rebuild_hbase.sh 2.2.6 "
+  echo "Supply the Hbase version as paramater i.e.: rebuild_hbase.sh 2.2.6 "
 fi
 
 mkdir "$ARTIFACTS_DIR"
@@ -57,6 +57,10 @@ mkdir "$WORK_DIR"
 $DEV_SUPPORT/cache-apache-project-artifact.sh --keys https://downloads.apache.org/hbase/KEYS \
     --working-dir "$WORK_DIR" "$ARTIFACTS_DIR/$HBASE_SOURCE_NAME" "$HBASE_SOURCE_MIRROR_NAME"
 
+if [[ ! -z "$MAVEN_SETTINGS_FILE" ]]; then
+  SETTINGS=( "--settings" "$MAVEN_SETTINGS_FILE" )
+fi
+
 STARTDIR=$PWD
 cd $ARTIFACTS_DIR
 tar xfz hbase-$HBASE_VERSION-src.tar.gz
diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml
index 2e7b6a1..2bb8222 100644
--- a/phoenix-assembly/pom.xml
+++ b/phoenix-assembly/pom.xml
@@ -53,11 +53,11 @@
               <arguments>
                 <argument>-fnsv</argument>
                 <argument>
-                  phoenix-client-${project.version}.jar
+                  phoenix-client-${hbase.suffix}-${project.version}.jar
                 </argument>
                 <argument>
                   <!-- We are overwriting the unshaded client JAR, but we don't care -->
-                  phoenix-client.jar
+                  phoenix-client-${hbase.suffix}.jar
                 </argument>
               </arguments>
             </configuration>
@@ -74,11 +74,11 @@
               <arguments>
                 <argument>-fnsv</argument>
                 <argument>
-                  phoenix-server-${project.version}.jar
+                  phoenix-server-${hbase.suffix}-${project.version}.jar
                 </argument>
                 <argument>
                   <!-- We are overwriting the unshaded server JAR, but we don't care -->
-                  phoenix-server.jar
+                  phoenix-server-${hbase.suffix}.jar
                 </argument>
               </arguments>
             </configuration>
@@ -107,7 +107,7 @@
               <goal>single</goal>
             </goals>
             <configuration>
-            <finalName>phoenix-${project.version}-bin</finalName>
+            <finalName>phoenix-${hbase.suffix}-${project.version}-bin</finalName>
               <attach>false</attach>
               <tarLongFileMode>gnu</tarLongFileMode>
               <appendAssemblyId>false</appendAssemblyId>
@@ -126,11 +126,11 @@
     <!-- Depend on all other internal projects -->
     <dependency>
       <groupId>org.apache.phoenix</groupId>
-      <artifactId>phoenix-server</artifactId>
+      <artifactId>phoenix-server-${hbase.suffix}</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.phoenix</groupId>
-      <artifactId>phoenix-client</artifactId>
+      <artifactId>phoenix-client-${hbase.suffix}</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.phoenix</groupId>
@@ -140,18 +140,6 @@
       <groupId>org.apache.phoenix</groupId>
       <artifactId>phoenix-tracing-webapp</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.apache.phoenix</groupId>
-      <artifactId>phoenix-hbase-compat-2.1.6</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.phoenix</groupId>
-      <artifactId>phoenix-hbase-compat-2.2.1</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.phoenix</groupId>
-      <artifactId>phoenix-hbase-compat-2.3.0</artifactId>
-    </dependency>
 
     <dependency>
       <groupId>com.fasterxml.woodstox</groupId>
diff --git a/phoenix-assembly/src/build/components/all-common-dependencies.xml b/phoenix-assembly/src/build/components/all-common-dependencies.xml
index 52bd8fd..63ffdf7 100644
--- a/phoenix-assembly/src/build/components/all-common-dependencies.xml
+++ b/phoenix-assembly/src/build/components/all-common-dependencies.xml
@@ -23,15 +23,6 @@
   <!-- All of our dependencies -->
   <dependencySets>
     <dependencySet>
-      <unpack>false</unpack>
-      <outputDirectory>/</outputDirectory>
-      <includes>
-        <include>org.apache.phoenix:phoenix-hbase-compat-2.1.6</include>
-        <include>org.apache.phoenix:phoenix-hbase-compat-2.2.1</include>
-        <include>org.apache.phoenix:phoenix-hbase-compat-2.3.0</include>
-      </includes>
-    </dependencySet>
-    <dependencySet>
       <!-- Unpack all the dependencies to class files, since java doesn't support
         jar of jars for running -->
       <unpack>false</unpack>
diff --git a/phoenix-assembly/src/build/components/all-common-jars.xml b/phoenix-assembly/src/build/components/all-common-jars.xml
index 93f82f2..ea5232b 100644
--- a/phoenix-assembly/src/build/components/all-common-jars.xml
+++ b/phoenix-assembly/src/build/components/all-common-jars.xml
@@ -27,14 +27,14 @@
       <directory>${project.basedir}/../phoenix-client-parent/phoenix-client/target</directory>
       <outputDirectory>/</outputDirectory>
       <includes>
-        <include>phoenix-client-${project.version}.jar</include>
+        <include>phoenix-client-${hbase.suffix}-${project.version}.jar</include>
       </includes>
     </fileSet>
     <fileSet>
       <directory>${project.basedir}/../phoenix-server/target</directory>
       <outputDirectory>/</outputDirectory>
       <includes>
-        <include>phoenix-server-${project.version}.jar</include>
+        <include>phoenix-server-${hbase.suffix}-${project.version}.jar</include>
       </includes>
     </fileSet>
 
diff --git a/phoenix-client-parent/phoenix-client-embedded/pom.xml b/phoenix-client-parent/phoenix-client-embedded/pom.xml
index bd85027..921cbc7 100644
--- a/phoenix-client-parent/phoenix-client-embedded/pom.xml
+++ b/phoenix-client-parent/phoenix-client-embedded/pom.xml
@@ -24,9 +24,10 @@
     <artifactId>phoenix-client-parent</artifactId>
     <version>5.1.0-SNAPSHOT</version>
   </parent>
-  <artifactId>phoenix-client-embedded</artifactId>
-  <name>Phoenix Client Embedded</name>
-  <description>Phoenix Client without logging implementation</description>
+
+  <artifactId>phoenix-client-embedded-${hbase.suffix}</artifactId>
+  <name>Phoenix Client Embedded for HBase ${hbase.profile}</name>
+  <description>Phoenix Client without logging implementation for for HBase ${hbase.profile}</description>
   <packaging>jar</packaging>
 
   <build>
diff --git a/phoenix-client-parent/phoenix-client/pom.xml b/phoenix-client-parent/phoenix-client/pom.xml
index 4781c3f..330a067 100644
--- a/phoenix-client-parent/phoenix-client/pom.xml
+++ b/phoenix-client-parent/phoenix-client/pom.xml
@@ -24,9 +24,10 @@
     <artifactId>phoenix-client-parent</artifactId>
     <version>5.1.0-SNAPSHOT</version>
   </parent>
-  <artifactId>phoenix-client</artifactId>
-  <name>Phoenix Client</name>
-  <description>Phoenix Client</description>
+
+  <artifactId>phoenix-client-${hbase.suffix}</artifactId>
+  <name>Phoenix Client for HBase ${hbase.profile}</name>
+  <description>Phoenix Client for HBase ${hbase.profile}</description>
   <packaging>jar</packaging>
 
   <build>
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index fd25797..9fbbc8f 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -609,5 +609,20 @@
       </dependency>
     </dependencies>
   </profile>
+  <profile>
+    <id>phoenix-hbase-compat-2.4.0-default</id>
+    <!-- keep dependency plugin happy -->
+    <activation>
+      <property>
+        <name>!hbase.profile</name>
+      </property>
+    </activation>
+    <dependencies>
+      <dependency>
+        <groupId>org.apache.zookeeper</groupId>
+        <artifactId>zookeeper-jute</artifactId>
+      </dependency>
+    </dependencies>
+  </profile>
 </profiles>
 </project>
diff --git a/phoenix-server/pom.xml b/phoenix-server/pom.xml
index be4324c..8e108ba 100644
--- a/phoenix-server/pom.xml
+++ b/phoenix-server/pom.xml
@@ -26,9 +26,9 @@
     <artifactId>phoenix</artifactId>
     <version>5.1.0-SNAPSHOT</version>
   </parent>
-  <artifactId>phoenix-server</artifactId>
-  <name>Phoenix Server</name>
-  <description>Phoenix Server</description>
+  <artifactId>phoenix-server-${hbase.suffix}</artifactId>
+  <name>Phoenix Server JAR for HBase ${hbase.profile}</name>
+  <description>Phoenix HBase Server Side JAR for HBase ${hbase.profile}</description>
   <packaging>jar</packaging>
   <properties>
     <!-- Don't make a test-jar -->
@@ -443,5 +443,21 @@
         </dependency>
       </dependencies>
     </profile>
+    <profile>
+      <id>phoenix-hbase-compat-2.4.0-default</id>
+      <!-- keep dependency plugin happy -->
+      <activation>
+        <property>
+          <name>!hbase.profile</name>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.zookeeper</groupId>
+          <artifactId>zookeeper-jute</artifactId>
+          <scope>provided</scope>
+        </dependency>
+      </dependencies>
+    </profile>
   </profiles>
 </project>
diff --git a/pom.xml b/pom.xml
index 85ec281..9708f89 100644
--- a/pom.xml
+++ b/pom.xml
@@ -75,9 +75,6 @@
   </scm>
 
   <properties>
-    <!-- The HBase compatibility module that that will be included in
-    the shaded JARs and the assembly -->
-    <hbase.profile>2.2</hbase.profile>
 
     <!-- Hadoop and Hbase-thirdparty version -->
     <!-- These are expected to be overridden to conform to cluster versions
@@ -86,6 +83,15 @@
     <hbase.thirdparty.version>2.2.1</hbase.thirdparty.version>
 
     <phoenix.thirdparty.version>1.0.0</phoenix.thirdparty.version>
+    <hbase.suffix>hbase-${hbase.profile}</hbase.suffix>
+
+    <!-- This is used by the release script only -->
+    <hbase.profile.list>2.1 2.2 2.3 2.4</hbase.profile.list>
+    <!-- The default hbase versions to build with (override with hbase.version) -->
+    <hbase-2.1.runtime.version>2.1.10</hbase-2.1.runtime.version>
+    <hbase-2.2.runtime.version>2.2.6</hbase-2.2.runtime.version>
+    <hbase-2.3.runtime.version>2.3.3</hbase-2.3.runtime.version>
+    <hbase-2.4.runtime.version>2.4.0</hbase-2.4.runtime.version>
 
     <!-- General Properties -->
     <antlr-input.dir>src/main/antlr3</antlr-input.dir>
@@ -636,12 +642,42 @@
       </dependency>
       <dependency>
         <groupId>org.apache.phoenix</groupId>
-        <artifactId>phoenix-client</artifactId>
+        <artifactId>phoenix-client-hbase-2.1</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.phoenix</groupId>
+        <artifactId>phoenix-client-hbase-2.2</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.phoenix</groupId>
+        <artifactId>phoenix-client-hbase-2.3</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.phoenix</groupId>
+        <artifactId>phoenix-client-hbase-2.4</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.phoenix</groupId>
+        <artifactId>phoenix-server-hbase-2.1</artifactId>
         <version>${project.version}</version>
       </dependency>
       <dependency>
         <groupId>org.apache.phoenix</groupId>
-        <artifactId>phoenix-server</artifactId>
+        <artifactId>phoenix-server-hbase-2.2</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.phoenix</groupId>
+        <artifactId>phoenix-server-hbase-2.3</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.phoenix</groupId>
+        <artifactId>phoenix-server-hbase-2.4</artifactId>
         <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -1516,17 +1552,22 @@
     <!-- The dependencies should be defined only in phoenix-core
     ,but maven doesn't seem to support that -->
     <profile>
-      <!-- must be identical to phoenix-hbase-compat-2.1.6 profile -->
-      <id>phoenix-hbase-compat-2.1.6-default</id>
+      <!-- must be identical to phoenix-hbase-compat-2.4.0 profile -->
+      <!-- PHOENIX-5993 This won't work with the public HBase artifacts -->
+      <id>phoenix-hbase-compat-2.4.0-default</id>
       <activation>
         <property>
           <name>!hbase.profile</name>
         </property>
       </activation>
       <properties>
-        <hbase.profile>2.1</hbase.profile>
-        <hbase.compat.version>2.1.6</hbase.compat.version>
-        <hbase.version>2.1.10</hbase.version>
+        <hbase.profile>2.4</hbase.profile>
+        <hbase.compat.version>2.4.0</hbase.compat.version>
+        <hbase.version>${hbase-2.4.runtime.version}</hbase.version>
+        <!-- PHOENIX-6010 3.1.3 doesn't work because of Guava rebase -->
+        <hadoop.version>3.1.2</hadoop.version>
+        <hbase.thirdparty.version>3.4.1</hbase.thirdparty.version>
+        <zookeeper.version>3.5.7</zookeeper.version>
       </properties>
     </profile>
     <profile>
@@ -1541,7 +1582,7 @@
       <properties>
         <hbase.profile>2.1</hbase.profile>
         <hbase.compat.version>2.1.6</hbase.compat.version>
-        <hbase.version>2.1.9</hbase.version>
+        <hbase.version>${hbase-2.1.runtime.version}</hbase.version>
       </properties>
     </profile>
     <profile>
@@ -1556,7 +1597,7 @@
       <properties>
         <hbase.profile>2.2</hbase.profile>
         <hbase.compat.version>2.2.1</hbase.compat.version>
-        <hbase.version>2.2.6</hbase.version>
+        <hbase.version>${hbase-2.2.runtime.version}</hbase.version>
         <!-- PHOENIX-6010 3.1.3 doesn't work because of Guava rebase -->
         <hadoop.version>3.1.2</hadoop.version>
       </properties>
@@ -1573,7 +1614,7 @@
       <properties>
         <hbase.profile>2.3</hbase.profile>
         <hbase.compat.version>2.3.0</hbase.compat.version>
-        <hbase.version>2.3.3</hbase.version>
+        <hbase.version>${hbase-2.3.runtime.version}</hbase.version>
         <!-- PHOENIX-6010 3.1.3 doesn't work because of Guava rebase -->
         <hadoop.version>3.1.2</hadoop.version>
         <hbase.thirdparty.version>3.3.0</hbase.thirdparty.version>
@@ -1592,7 +1633,7 @@
       <properties>
         <hbase.profile>2.4</hbase.profile>
         <hbase.compat.version>2.4.0</hbase.compat.version>
-        <hbase.version>2.4.0</hbase.version>
+        <hbase.version>${hbase-2.4.runtime.version}</hbase.version>
         <!-- PHOENIX-6010 3.1.3 doesn't work because of Guava rebase -->
         <hadoop.version>3.1.2</hadoop.version>
         <hbase.thirdparty.version>3.4.1</hbase.thirdparty.version>