This is an automated email from the ASF dual-hosted git repository.
nihaljain pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase-thirdparty.git
The following commit(s) were added to refs/heads/master by this push:
new fd76b1e HBASE-29225 [hbase-thirdparty] Add module for Jetty 12 with
EE8 and add support for toolchain based JDK selection (#142)
fd76b1e is described below
commit fd76b1eec91d40c97c59a2a36e8f430ce05d6788
Author: Nihal Jain <[email protected]>
AuthorDate: Fri Jul 25 14:06:01 2025 +0530
HBASE-29225 [hbase-thirdparty] Add module for Jetty 12 with EE8 and add
support for toolchain based JDK selection (#142)
**Part 1**
First, we add a new set of modules which we will need for Jetty 12
migration. The code has been modularised into following modules:
- `hbase-shaded-jetty-12-plus-core`
- `hbase-shaded-jetty-12-plus-ee8`
So basically:
- Branches which want to consume EE8 may need to add
`hbase-shaded-jetty-12-plus-core` and `hbase-shaded-jetty-12-plus-ee8` in their
dependency replacing the former `hbase-shaded-jetty`
- Branches which want to consume EE9/EE10 may need to add a new module for
same in `hbase-thirdparty` in future
**Part 2**
Implement a maven toolchains-based build system to support both JDK 8 and
JDK 17 compilation in a single branch with configurable setup:
- Add toolchains plugin configuration for automatic JDK selection based on
module requirements
- Maintain JDK 8 requirement for `hbase-unsafe` and `hbase-shaded-protobuf`
modules
- Configure all other modules to use JDK 17 compilation with JDK 8 release
target
- Split `maven-enforcer-plugin` into separate profiles for JDK 8/JDK 17
bytecode validation
- Add `generate-toolchains.sh` script for dynamic toolchains.xml generation
with environment variable support
- Support `JAVA8_HOME`/`JAVA17_HOME` environment variable configuration for
local development
- Add fallback auto-detection for Java installations at
`/usr/lib/jvm/java-8` and `/usr/lib/jvm/java-17` (CI/Jenkins paths)
- Add comprehensive documentation with local development setup commands and
toolchain explanations
**Part 3**:
Fix Jenkins build failures by implementing Docker-based multi-JDK
environment with automated toolchain management:
- Add multi-stage Dockerfile with JDK 8 and JDK 17
- Install JDKs at standardized paths (/usr/lib/jvm/java-8,
/usr/lib/jvm/java-17) matching toolchain expectations
- Create Maven wrapper that automatically passes `-t
dev-support/toolchains-jenkins.xml` to all mvn invocations
- Add pre-configured `dev-support/toolchains-jenkins.xml` with fixed JDK
paths for Jenkins environment
- Configure Jenkinsfile environment variables (JAVA8_HOME, JAVA17_HOME,
SET_JAVA_HOME)
- Update README documentation with comprehensive CI/Jenkins setup
explanation
This resolves Jenkins build failures introduced by the toolchains-based
build system (Part 2) by providing the required dual JDK environment and
automatic toolchain configuration. Jenkins builds now work seamlessly with:
- hbase-unsafe and hbase-shaded-protobuf using JDK 8
- All other modules including Jetty 12 modules using JDK 17 with JDK 8
target
- No manual toolchain configuration required in CI environment
Completes the three-part implementation enabling HBase 2.x (JDK 8 + Jetty
9) and HBase 3.x (JDK 17 + Jetty 12) support in a single branch.
Signed-off-by: Dávid Paksy <[email protected]>
Signed-off-by: Duo Zhang <[email protected]>
---
.gitignore | 1 +
README.md | 123 ++++++++++++++-
dev-support/generate-toolchains.sh | 62 ++++++++
dev-support/jenkins/Dockerfile | 119 +++++++++++++--
dev-support/jenkins/Jenkinsfile | 6 +-
dev-support/toolchains-jenkins.xml | 41 +++++
hbase-shaded-jetty-12-plus-core/pom.xml | 228 ++++++++++++++++++++++++++++
hbase-shaded-jetty-12-plus-ee8/pom.xml | 257 ++++++++++++++++++++++++++++++++
hbase-shaded-protobuf/pom.xml | 9 ++
hbase-unsafe/pom.xml | 6 +
pom.xml | 143 ++++++++++++++----
11 files changed, 945 insertions(+), 50 deletions(-)
diff --git a/.gitignore b/.gitignore
index 8f1e942..f4b640b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@ hbase-shaded-protobuf/src/main/resources
.idea
*.iml
.flattened-pom.xml
+toolchains.xml
diff --git a/README.md b/README.md
index 1fa036d..ff026e5 100644
--- a/README.md
+++ b/README.md
@@ -86,20 +86,129 @@ In case build fails due to protobuf-java version change,
we can follow below ste
---
-Note that this project requires JDK8. This is because a bunch of the code we
-have in hbase-unsafe is using old APIs that have been removed from more
-modern JDKs. Due to a bug in JDK, we cannot generate this code using a more
-modern version of the JDK. See
-[HBASE-26773](https://issues.apache.org/jira/browse/HBASE-26773) for details.
+## Dual JDK Requirements
+
+Starting with version 4.1.12, this project requires both JDK 8 and JDK 17 to
accommodate different HBase versions:
+
+- **HBase 2.x**: Uses JDK 8 compatible modules (including `hbase-shaded-jetty`
with Jetty 9)
+- **HBase 3.x**: Uses JDK 17 modules (including `hbase-shaded-jetty-12-plus-*`
with Jetty 12)
+
+Jetty 12 requires JDK 17 for compilation, but HBase 2.x deployments cannot
move to Jetty 12 for JDK 8 compatibility. Our solution provides a single
release containing modules for both JDK versions, eliminating the need for
separate branches or releases.
+
+### JDK 8 Required Modules
+
+This project has specific JDK requirements for different modules:
+
+- **hbase-unsafe**: Must be built with JDK 8 because it uses old APIs that
have been removed from more modern JDKs. Due to a bug in JDK, we cannot
generate this code using a more modern version of the JDK. See
[HBASE-26773](https://issues.apache.org/jira/browse/HBASE-26773) for details.
+- **hbase-shaded-protobuf**: Must be built with JDK 8 because it depends on
internal Java APIs such as `sun.misc.Unsafe`. These internal APIs are
inaccessible when compiling with newer JDKs but release target set to JDK 8.
+
+### JDK 17 Compilation with JDK 8 Target
+
+**All other modules** (including Jetty 12 modules) use JDK 17 for compilation
but with release target set to JDK 8.
+
+### Maven Enforcer Plugin Profiles
+
+The project uses Maven enforcer plugin profiles to ensure these requirements
are met:
+- **enforce-jdk8-bytecode**: Ensures hbase-unsafe and hbase-shaded-protobuf
are built with JDK 8.
+- **enforce-jdk17-bytecode**: For **Jetty 12 modules**
(hbase-shaded-jetty-12-plus-*), the enforcer plugin allows JDK 17 bytecode to
be included from Jetty 12 dependencies, while still using JDK 8 as the release
target.
+
+### Why toolchains are required?
+
+Maven needs explicit toolchain configuration to automatically select JDK 8 for
hbase-unsafe and hbase-shaded-protobuf modules, and JDK 17 for all other
modules including Jetty 12 modules. Environment variables alone are
insufficient.
+
+### Files
+- `dev-support/generate-toolchains.sh` - Script to generate toolchains.xml
with configurable paths
+- `toolchains.xml` - Generated Maven toolchains configuration file (not
checked in)
## Build/Deploy
-To build, make sure that your environment uses JDK8, then just run:
+### Local Development Setup
+
+1. **Install both JDK versions**: JDK 8 and JDK 17
+2. **Set environment variables**:
+ ```sh
+ export JAVA8_HOME=/path/to/your/jdk8
+ export JAVA17_HOME=/path/to/your/jdk17
+ ```
+3. **Choose your toolchain setup approach** (see options below)
+
+### Toolchain Setup Options
+
+**Option 1: Project-local toolchains.xml**
+```sh
+# Generate and use project-specific toolchains
+export JAVA8_HOME=/path/to/your/jdk8
+export JAVA17_HOME=/path/to/your/jdk17
+
+# Below command will generate toolchains.xml in project root
+./dev-support/generate-toolchains.sh
+
+# Run build by passing toolchains.xml file to maven
+mvn clean install -t toolchains.xml
+```
+**Option 2: Global Maven toolchains setup**
```sh
-mvn clean package
+# Setup toolchains in ~/.m2/ directory
+export JAVA8_HOME=/path/to/your/jdk8
+export JAVA17_HOME=/path/to/your/jdk17
+
+# Below command will generate toolchains.xml in project root
+./dev-support/generate-toolchains.sh
+
+# Copy the generated file to global .m2 directory
+cp toolchains.xml ~/.m2/toolchains.xml
+
+# Run build as usual
+mvn clean install
```
+### CI/Jenkins Setup
+
+The Jenkins CI environment uses a Docker-based build system that automatically
handles the dual JDK requirements without any manual configuration.
+
+#### Multi-JDK Docker Environment
+
+The Jenkins build uses a custom Dockerfile (`dev-support/jenkins/Dockerfile`)
that:
+- Downloads and installs both JDK 8 (Adoptium Temurin) and JDK 17 (Adoptium
Temurin)
+- Places them at standardized paths:
+ - Java 8: `/usr/lib/jvm/java-8`
+ - Java 17: `/usr/lib/jvm/java-17`
+- Includes Maven 3.9.8 for the build process
+
+#### Maven Wrapper with Automatic Toolchains
+
+The Docker image creates a Maven wrapper that automatically handles toolchain
configuration by replacing the original `mvn` command with a wrapper that
always passes the `-t ${BASEDIR}/dev-support/toolchains-jenkins.xml` parameter
to ensure the correct toolchains file is used for every Maven invocation.
+
+#### Automatic JDK Selection
+
+The system uses a pre-configured toolchains file
(`dev-support/toolchains-jenkins.xml`) that:
+- Defines JDK 1.8 toolchain pointing to `/usr/lib/jvm/java-8`
+- Defines JDK 17 toolchain pointing to `/usr/lib/jvm/java-17`
+- Allows Maven to automatically select the correct JDK for each module based
on the toolchain requirements in their POMs
+
+#### Jenkins Build Process
+
+In Jenkins, the build process is completely automated:
+1. Docker container starts with both JDKs pre-installed
+2. Maven wrapper automatically passes the toolchains configuration
+3. Each module uses the appropriate JDK version:
+ - `hbase-unsafe` and `hbase-shaded-protobuf`: Built with JDK 8
+ - All other modules: Built with JDK 17 (with JDK 8 release target)
+4. No manual toolchain setup or environment configuration required
+
+#### Environment Variables
+
+The Jenkinsfile sets the following environment variables:
+```bash
+SET_JAVA_HOME="/usr/lib/jvm/java-17" # Default JDK for the build
+JAVA8_HOME="/usr/lib/jvm/java-8" # JDK 8 location
+JAVA17_HOME="/usr/lib/jvm/java-17" # JDK 17 location
+```
+
+This automated setup ensures consistent builds across all Jenkins jobs without
requiring developers or maintainers to manually configure toolchains in the CI
environment.
+
+
## Release
To cut a release candidate, update JIRA. The hbase-thirdparty currently uses
diff --git a/dev-support/generate-toolchains.sh
b/dev-support/generate-toolchains.sh
new file mode 100755
index 0000000..be764c1
--- /dev/null
+++ b/dev-support/generate-toolchains.sh
@@ -0,0 +1,62 @@
+#!/usr/bin/env 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.
+
+# Script to generate toolchains.xml with configurable Java paths
+
+# Set default paths if environment variables are not set
+if [ -z "$JAVA8_HOME" ]; then
+ echo "Trying to detect Java 8 installation (Jenkins/CI standard path)"
+ if [ -d "/usr/lib/jvm/java-8" ]; then
+ JAVA8_HOME="/usr/lib/jvm/java-8"
+ else
+ echo "Warning: JAVA8_HOME not set and Java 8 not found at
/usr/lib/jvm/java-8"
+ echo "For local development, please set JAVA8_HOME environment
variable"
+ JAVA8_HOME="/usr/lib/jvm/java-8"
+ fi
+fi
+
+if [ -z "$JAVA17_HOME" ]; then
+ echo "Trying to detect Java 17 installation (Jenkins/CI standard path)"
+ if [ -d "/usr/lib/jvm/java-17" ]; then
+ JAVA17_HOME="/usr/lib/jvm/java-17"
+ else
+ echo "Warning: JAVA17_HOME not set and Java 17 not found at
/usr/lib/jvm/java-17"
+ echo "For local development, please set JAVA17_HOME environment
variable"
+ JAVA17_HOME="/usr/lib/jvm/java-17"
+ fi
+fi
+
+TEMPLATE_FILE="./dev-support/toolchains-jenkins.xml"
+OUTPUT_FILE="toolchains.xml"
+
+if [ ! -f "$TEMPLATE_FILE" ]; then
+ echo "Template file $TEMPLATE_FILE not found!"
+ exit 1
+fi
+
+echo "Generating toolchains.xml with:"
+echo " JAVA8_HOME: $JAVA8_HOME"
+echo " JAVA17_HOME: $JAVA17_HOME"
+
+# Substitute placeholders and write output
+sed \
+ -e "s|/usr/lib/jvm/java-8|$JAVA8_HOME|g" \
+ -e "s|/usr/lib/jvm/java-17|$JAVA17_HOME|g" \
+ "$TEMPLATE_FILE" > "$OUTPUT_FILE"
+
+echo "toolchains.xml generated successfully!"
diff --git a/dev-support/jenkins/Dockerfile b/dev-support/jenkins/Dockerfile
index 9119a2b..5ebc37d 100644
--- a/dev-support/jenkins/Dockerfile
+++ b/dev-support/jenkins/Dockerfile
@@ -14,21 +14,112 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Dockerfile for hbase-operator-tools pre-commit build.
-# https://builds.apache.org/job/PreCommit-HBASE-OPERATOR-TOOLS-Build
-
-FROM maven:3.9-eclipse-temurin-8
-
-# hadolint ignore=DL3008
-RUN apt-get -q update && apt-get -q install --no-install-recommends -y \
- binutils \
- git \
- rsync \
- shellcheck \
- patch \
- wget && \
+# Dockerfile for hbase-thirdparty pre-commit build.
+#
+#
+# Built in multiple stages so as to avoid re-downloading large binaries when
+# tweaking unrelated aspects of the image.
+FROM ubuntu:22.04 AS base_image
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get -qq update && \
+ DEBIAN_FRONTEND=noninteractive apt-get -qq install --no-install-recommends
-y \
+ ca-certificates=20211016 \
+ curl='7.81.0-*' \
+ locales='2.35-*' \
+ bash='5.1-*' \
+ binutils='2.38-*' \
+ build-essential=12.9ubuntu3 \
+ git='1:2.34.1-*' \
+ rsync='3.2.3-*' \
+ tar='1.34+dfsg-*' \
+ wget='1.21.2-*' \
+ shellcheck='0.8.0-*' \
+ patch='2.7.6-*' \
+ && \
apt-get clean && \
- rm -rf /var/lib/apt/lists/*
+ rm -rf /var/lib/apt/lists/* \
+ && \
+ locale-gen en_US.UTF-8
+ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
+
+##
+# download sundry dependencies
+#
+
+FROM base_image AS maven_download_image
+ENV MAVEN_VERSION='3.9.8'
+ENV
MAVEN_URL="https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
+ENV
MAVEN_SHA512='7d171def9b85846bf757a2cec94b7529371068a0670df14682447224e57983528e97a6d1b850327e4ca02b139abaab7fcb93c4315119e6f0ffb3f0cbc0d0b9a2'
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+RUN curl --location --fail --silent --show-error --output /tmp/maven.tar.gz
"${MAVEN_URL}" && \
+ echo "${MAVEN_SHA512} */tmp/maven.tar.gz" | sha512sum -c -
+
+FROM base_image AS openjdk8_download_image
+ENV
OPENJDK8_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u412-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u412b08.tar.gz'
+ENV
OPENJDK8_SHA256='b9884a96f78543276a6399c3eb8c2fd8a80e6b432ea50e87d3d12d495d1d2808'
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+RUN curl --location --fail --silent --show-error --output
/tmp/adoptopenjdk8.tar.gz "${OPENJDK8_URL}" && \
+ echo "${OPENJDK8_SHA256} */tmp/adoptopenjdk8.tar.gz" | sha256sum -c -
+
+FROM base_image AS openjdk17_download_image
+ENV
OPENJDK17_URL='https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.11_9.tar.gz'
+ENV
OPENJDK17_SHA256='aa7fb6bb342319d227a838af5c363bfa1b4a670c209372f9e6585bd79da6220c'
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+RUN curl --location --fail --silent --show-error --output
/tmp/adoptopenjdk17.tar.gz "${OPENJDK17_URL}" && \
+ echo "${OPENJDK17_SHA256} */tmp/adoptopenjdk17.tar.gz" | sha256sum -c -
+
+##
+# build the final image
+#
+
+FROM base_image
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+
+# hadolint ignore=DL3010
+COPY --from=maven_download_image /tmp/maven.tar.gz /tmp/maven.tar.gz
+RUN tar xzf /tmp/maven.tar.gz -C /opt && \
+ ln -s "/opt/$(dirname "$(tar -tf /tmp/maven.tar.gz | head -n1)")" /opt/maven
&& \
+ rm /tmp/maven.tar.gz
+
+##
+# ensure JVMs are available under `/usr/lib/jvm` and prefix each installation
+# as `java-` so as to conform with Yetus's assumptions.
+#
+
+# hadolint ignore=DL3010
+COPY --from=openjdk8_download_image /tmp/adoptopenjdk8.tar.gz
/tmp/adoptopenjdk8.tar.gz
+RUN mkdir -p /usr/lib/jvm && \
+ tar xzf /tmp/adoptopenjdk8.tar.gz -C /usr/lib/jvm && \
+ ln -s "/usr/lib/jvm/$(basename "$(tar -tf /tmp/adoptopenjdk8.tar.gz | head
-n1)")" /usr/lib/jvm/java-8-adoptopenjdk && \
+ ln -s /usr/lib/jvm/java-8-adoptopenjdk /usr/lib/jvm/java-8 && \
+ rm /tmp/adoptopenjdk8.tar.gz
+
+# hadolint ignore=DL3010
+COPY --from=openjdk17_download_image /tmp/adoptopenjdk17.tar.gz
/tmp/adoptopenjdk17.tar.gz
+RUN mkdir -p /usr/lib/jvm && \
+ tar xzf /tmp/adoptopenjdk17.tar.gz -C /usr/lib/jvm && \
+ ln -s "/usr/lib/jvm/$(basename "$(tar -tf /tmp/adoptopenjdk17.tar.gz | head
-n1)")" /usr/lib/jvm/java-17-adoptopenjdk && \
+ ln -s /usr/lib/jvm/java-17-adoptopenjdk /usr/lib/jvm/java-17 && \
+ rm /tmp/adoptopenjdk17.tar.gz
+
+# configure default environment for Yetus
+ENV MAVEN_HOME='/opt/maven'
+
+# create a wrapper for mvn to always pass the toolchains.xml file
+RUN mv /opt/maven/bin/mvn /opt/maven/bin/mvn-original && \
+ cat > /opt/maven/bin/mvn <<'EOF'
+#!/bin/bash
+TOOLCHAIN="${BASEDIR}/dev-support/toolchains-jenkins.xml"
+if [ -f "$TOOLCHAIN" ]; then
+ echo "Added: -t ${TOOLCHAIN} to mvn flags!"
+ exec ${MAVEN_HOME}/bin/mvn-original "$@" -t "$TOOLCHAIN"
+else
+ echo "Unexpected: ${TOOLCHAIN} file is missing!"
+ exec ${MAVEN_HOME}/bin/mvn-original "$@"
+fi
+EOF
+RUN chmod +x /opt/maven/bin/mvn && cat /opt/maven/bin/mvn
CMD ["/bin/bash"]
diff --git a/dev-support/jenkins/Jenkinsfile b/dev-support/jenkins/Jenkinsfile
index 00649d0..e6d9b97 100644
--- a/dev-support/jenkins/Jenkinsfile
+++ b/dev-support/jenkins/Jenkinsfile
@@ -53,7 +53,9 @@ pipeline {
DOCKERFILE_REL = "${SRC_REL}/dev-support/jenkins/Dockerfile"
YETUS_DRIVER_REL =
"${SRC_REL}/dev-support/jenkins/jenkins_precommit_github_yetus.sh"
ARCHIVE_PATTERN_LIST = '*.dump'
- SET_JAVA_HOME = '/opt/java/openjdk'
+ SET_JAVA_HOME = "/usr/lib/jvm/java-17"
+ JAVA8_HOME = "/usr/lib/jvm/java-8"
+ JAVA17_HOME = "/usr/lib/jvm/java-17"
PLUGINS = 'all'
}
@@ -147,7 +149,7 @@ pipeline {
}
tools {
// this needs to be set to the jdk that ought to be used to
build releases on the branch the Jenkinsfile is stored in.
- jdk "jdk_1.8_latest"
+ jdk "jdk_17_latest"
}
stages {
stage ('setup') {
diff --git a/dev-support/toolchains-jenkins.xml
b/dev-support/toolchains-jenkins.xml
new file mode 100644
index 0000000..88bb0fe
--- /dev/null
+++ b/dev-support/toolchains-jenkins.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0
http://maven.apache.org/xsd/toolchains-1.1.0.xsd">
+ <!--
+/**
+ * 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.
+ */
+-->
+ <toolchain>
+ <type>jdk</type>
+ <provides>
+ <version>1.8</version>
+ </provides>
+ <configuration>
+ <jdkHome>/usr/lib/jvm/java-8</jdkHome>
+ </configuration>
+ </toolchain>
+ <toolchain>
+ <type>jdk</type>
+ <provides>
+ <version>17</version>
+ </provides>
+ <configuration>
+ <jdkHome>/usr/lib/jvm/java-17</jdkHome>
+ </configuration>
+ </toolchain>
+</toolchains>
diff --git a/hbase-shaded-jetty-12-plus-core/pom.xml
b/hbase-shaded-jetty-12-plus-core/pom.xml
new file mode 100644
index 0000000..5756391
--- /dev/null
+++ b/hbase-shaded-jetty-12-plus-core/pom.xml
@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <!--
+/**
+ * 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.
+ */
+
+
+ ON MVN COMPILE NOT WORKING
+
+ If you wondering why 'mvn compile' does not work building HBase
+ (in particular, if you are doing it for the first time), instead do
+ 'mvn package'. If you are interested in the full story, see
+ https://issues.apache.org/jira/browse/HBASE-6795.
+
+-->
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.hbase.thirdparty</groupId>
+ <artifactId>hbase-thirdparty</artifactId>
+ <version>${revision}</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>hbase-shaded-jetty-12-plus-core</artifactId>
+ <name>Apache HBase Relocated (Shaded) Jetty 12+ Libs: Core</name>
+ <description>Pulls down Jetty core, relocates it and makes a far
jar.</description>
+ <properties>
+ <!-- Override bytecode enforcement for jetty modules -->
+ <skipJdk8BytecodeCheck>true</skipJdk8BytecodeCheck>
+ <skipJdk17BytecodeCheck>false</skipJdk17BytecodeCheck>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-http</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-io</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-jmx</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util-ajax</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-security</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-session</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-ee</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-xml</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>dependency-reduced-pom.xml</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <shadeSourcesContent>true</shadeSourcesContent>
+ <createSourcesJar>true</createSourcesJar>
+ <relocations>
+ <relocation>
+ <pattern>org.eclipse.jetty</pattern>
+
<shadedPattern>${rename.offset}.org.eclipse.jetty</shadedPattern>
+ </relocation>
+ <!--
+ This is for relocating the blacklist in
+ org.eclipse.jetty.webapp.WebAppContext.__dftServerClasses,
+ where we have a '-' in front of the class name
+ -->
+ <relocation>
+ <pattern>-org.eclipse.jetty</pattern>
+
<shadedPattern>-${rename.offset}.org.eclipse.jetty</shadedPattern>
+ </relocation>
+ </relocations>
+ <artifactSet>
+ <excludes>
+ <!--
+ Anything added here needs to be excluded from the jar
that pulls it in
+ also else we give an odd signal in the
META-INF/DEPENDENCIES that we
+ produce. See below for how to exclusion of transitive
dependencies.
+ -->
+ <exclude>org.slf4j:slf4j-api</exclude>
+ <!-- On the "next" build, exclude a lingering shaded jar if
it exists (user did not `clean`).
+ Maven will happily pick up the previous shaded jar and try
to include that in the N+1th build
+ if we don't exclude it. This will result in a failure in
the ServicesResourceTransformer claiming
+ that we've already packaged a services file once. -->
+
<exclude>org.apache.hbase.thirdparty:hbase-shaded-jetty-12-plus-core</exclude>
+ </excludes>
+ </artifactSet>
+ <transformers>
+ <transformer
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
+ <transformer
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
+ <addHeader>false</addHeader>
+ </transformer>
+ <transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+ </transformers>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/hbase-shaded-jetty-12-plus-ee8/pom.xml
b/hbase-shaded-jetty-12-plus-ee8/pom.xml
new file mode 100644
index 0000000..750ed72
--- /dev/null
+++ b/hbase-shaded-jetty-12-plus-ee8/pom.xml
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <!--
+/**
+ * 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.
+ */
+
+
+ ON MVN COMPILE NOT WORKING
+
+ If you wondering why 'mvn compile' does not work building HBase
+ (in particular, if you are doing it for the first time), instead do
+ 'mvn package'. If you are interested in the full story, see
+ https://issues.apache.org/jira/browse/HBASE-6795.
+
+-->
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.hbase.thirdparty</groupId>
+ <artifactId>hbase-thirdparty</artifactId>
+ <version>${revision}</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>hbase-shaded-jetty-12-plus-ee8</artifactId>
+ <name>Apache HBase Relocated (Shaded) Jetty 12+ Libs: EE8</name>
+ <description>Pulls down Jetty EE8, relocates it and makes a far
jar.</description>
+ <properties>
+ <!-- Override bytecode enforcement for jetty modules -->
+ <skipJdk8BytecodeCheck>true</skipJdk8BytecodeCheck>
+ <skipJdk17BytecodeCheck>false</skipJdk17BytecodeCheck>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.jetty.ee8</groupId>
+ <artifactId>jetty-ee8-servlet</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.ee8</groupId>
+ <artifactId>jetty-ee8-security</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.ee8</groupId>
+ <artifactId>jetty-ee8-nested</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.ee8</groupId>
+ <artifactId>jetty-ee8-webapp</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- List to dependencies which are part of core and we want to avoid
bundling,
+ hence keeping as provided here -->
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-http</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-io</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-jmx</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util-ajax</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-security</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-session</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-ee</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-xml</artifactId>
+ <version>${jetty-12-plus.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>dependency-reduced-pom.xml</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <shadeSourcesContent>true</shadeSourcesContent>
+ <createSourcesJar>true</createSourcesJar>
+ <relocations>
+ <relocation>
+ <pattern>org.eclipse.jetty</pattern>
+
<shadedPattern>${rename.offset}.org.eclipse.jetty</shadedPattern>
+ </relocation>
+ <!--
+ This is for relocating the blacklist in
+ org.eclipse.jetty.webapp.WebAppContext.__dftServerClasses,
+ where we have a '-' in front of the class name
+ -->
+ <relocation>
+ <pattern>-org.eclipse.jetty</pattern>
+
<shadedPattern>-${rename.offset}.org.eclipse.jetty</shadedPattern>
+ </relocation>
+ </relocations>
+ <artifactSet>
+ <excludes>
+ <!--
+ Anything added here needs to be excluded from the jar
that pulls it in
+ also else we give an odd signal in the
META-INF/DEPENDENCIES that we
+ produce. See below for how to exclusion of transitive
dependencies.
+ -->
+ <exclude>org.slf4j:slf4j-api</exclude>
+ <!-- On the "next" build, exclude a lingering shaded jar if
it exists (user did not `clean`).
+ Maven will happily pick up the previous shaded jar and try
to include that in the N+1th build
+ if we don't exclude it. This will result in a failure in
the ServicesResourceTransformer claiming
+ that we've already packaged a services file once. -->
+
<exclude>org.apache.hbase.thirdparty:hbase-shaded-jetty-12-plus-ee8</exclude>
+ </excludes>
+ </artifactSet>
+ <transformers>
+ <transformer
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
+ <transformer
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
+ <addHeader>false</addHeader>
+ </transformer>
+ <transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+ </transformers>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <!--
+ The webdefault-ee8.xml contains some jetty servlet classes which
should also be relocated
+ -->
+ <execution>
+ <id>relocate-web-xml</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <echo message="unjar"/>
+ <unzip dest="${project.build.directory}/unpacked/"
src="${project.build.directory}/${project.artifactId}-${project.version}.jar"/>
+ <echo message="Replace content in webdefault-ee8.xml"/>
+ <replace
file="${project.build.directory}/unpacked/${rename.offset.dir}/org/eclipse/jetty/ee8/webapp/webdefault-ee8.xml">
+ <replacetoken>org.eclipse.jetty</replacetoken>
+
<replacevalue>${rename.offset}.org.eclipse.jetty</replacevalue>
+ </replace>
+ <echo message="Redo jar"/>
+ <jar basedir="${project.build.directory}/unpacked"
destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar"/>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/hbase-shaded-protobuf/pom.xml b/hbase-shaded-protobuf/pom.xml
index 6ecbc35..89195df 100644
--- a/hbase-shaded-protobuf/pom.xml
+++ b/hbase-shaded-protobuf/pom.xml
@@ -29,6 +29,15 @@
<artifactId>hbase-shaded-protobuf</artifactId>
<name>Apache HBase Patched and Relocated (Shaded) Protobuf</name>
<description>Pulls down protobuf, patches it, compiles, and then
relocates/shades.</description>
+ <properties>
+ <!-- Override parent's JDK 17 settings to force JDK 8 for
hbase-shaded-protobuf.
+ hbase-shaded-protobuf must be built with JDK 8 because it depends on
internal Java APIs such as
+ sun.misc.Unsafe. These internal APIs are inaccessible when compiling with
newer JDKs using the
+ release setting in Maven. -->
+
<toolchain.jdk.version>${hbase.unsafe.and.protobuf.java.version}</toolchain.jdk.version>
+ <maven.compiler.source>${java.release.version}</maven.compiler.source>
+ <maven.compiler.target>${java.release.version}</maven.compiler.target>
+ </properties>
<build>
<plugins>
<plugin>
diff --git a/hbase-unsafe/pom.xml b/hbase-unsafe/pom.xml
index 4781911..64d32aa 100644
--- a/hbase-unsafe/pom.xml
+++ b/hbase-unsafe/pom.xml
@@ -41,6 +41,12 @@
<!-- These maybe need to match the main repo -->
<maven.checkstyle.version>3.1.0</maven.checkstyle.version>
<checkstyle.version>8.29</checkstyle.version>
+ <!-- Override parent's JDK 17 settings to force JDK 8 for hbase-unsafe -->
+
<toolchain.jdk.version>${hbase.unsafe.and.protobuf.java.version}</toolchain.jdk.version>
+ <maven.compiler.source>${java.release.version}</maven.compiler.source>
+ <maven.compiler.target>${java.release.version}</maven.compiler.target>
+ <!-- Override project level argline -->
+ <argLine/>
</properties>
<dependencies>
<dependency>
diff --git a/pom.xml b/pom.xml
index 00962ab..d90b68a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -100,6 +100,8 @@
<module>hbase-shaded-gson</module>
<module>hbase-shaded-miscellaneous</module>
<module>hbase-shaded-jetty</module>
+ <module>hbase-shaded-jetty-12-plus-core</module>
+ <module>hbase-shaded-jetty-12-plus-ee8</module>
<module>hbase-shaded-jersey</module>
<module>hbase-shaded-jackson-jaxrs-json-provider</module>
<module>hbase-noop-htrace</module>
@@ -125,8 +127,17 @@
<maven.javadoc.skip>true</maven.javadoc.skip>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm</maven.build.timestamp.format>
<buildDate>${maven.build.timestamp}</buildDate>
- <compileSource>1.8</compileSource>
- <java.min.version>${compileSource}</java.min.version>
+ <!-- Project level compilation properties -->
+
<hbase.unsafe.and.protobuf.java.version>1.8</hbase.unsafe.and.protobuf.java.version>
+ <java.version>17</java.version>
+ <java.release.version>8</java.release.version>
+ <maven.compiler.release>${java.release.version}</maven.compiler.release>
+ <!-- Project level Java toolchain JDK version -->
+ <toolchain.jdk.version>${java.version}</toolchain.jdk.version>
+ <!-- Project level bytecode enforcement control properties -->
+ <skipJdk8BytecodeCheck>false</skipJdk8BytecodeCheck>
+ <skipJdk17BytecodeCheck>true</skipJdk17BytecodeCheck>
+
<maven.min.version>3.3.3</maven.min.version>
<os.maven.version>1.7.1</os.maven.version>
<rename.offset>org.apache.hbase.thirdparty</rename.offset>
@@ -139,6 +150,7 @@
<error_prone_annotations.version>2.38.0</error_prone_annotations.version>
<gson.version>2.13.1</gson.version>
<jetty.version>9.4.57.v20241219</jetty.version>
+ <jetty-12-plus.version>12.0.22</jetty-12-plus.version>
<servlet-api.version>3.1.0</servlet-api.version>
<jersey.version>2.46</jersey.version>
<jakarta.inject.version>2.6.1</jakarta.inject.version>
@@ -148,6 +160,27 @@
<javassist.version>3.30.2-GA</javassist.version>
<jackson-jaxrs-json-provider.version>2.19.0</jackson-jaxrs-json-provider.version>
<spotless.version>2.30.0</spotless.version>
+
+ <!-- Below is copied from hbase project -->
+
<hbase-surefire.jdk17.flags>-Dorg.apache.hbase.thirdparty.io.netty.tryReflectionSetAccessible=true
+ --add-modules jdk.unsupported
+ --add-opens java.base/java.io=ALL-UNNAMED
+ --add-opens java.base/java.nio=ALL-UNNAMED
+ --add-opens java.base/sun.nio.ch=ALL-UNNAMED
+ --add-opens java.base/java.lang=ALL-UNNAMED
+ --add-opens java.base/jdk.internal.ref=ALL-UNNAMED
+ --add-opens java.base/java.lang.reflect=ALL-UNNAMED
+ --add-opens java.base/java.util=ALL-UNNAMED
+ --add-opens java.base/java.util.concurrent=ALL-UNNAMED
+ --add-exports java.base/jdk.internal.misc=ALL-UNNAMED
+ --add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED
+ --add-exports java.base/sun.net.dns=ALL-UNNAMED
+ --add-exports java.base/sun.net.util=ALL-UNNAMED
+ --add-opens java.base/jdk.internal.util.random=ALL-UNNAMED
+ --add-opens java.base/sun.security.x509=ALL-UNNAMED
+ --add-opens java.base/sun.security.util=ALL-UNNAMED
+ --add-opens java.base/java.net=ALL-UNNAMED</hbase-surefire.jdk17.flags>
+ <argLine>${hbase-surefire.jdk17.flags}</argLine>
</properties>
<build>
<pluginManagement>
@@ -245,11 +278,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.11.0</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
+ <version>3.13.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -276,6 +305,11 @@
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-toolchains-plugin</artifactId>
+ <version>3.2.0</version>
+ </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
@@ -297,6 +331,24 @@
</filesets>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-toolchains-plugin</artifactId>
+ <configuration>
+ <toolchains>
+ <jdk>
+ <version>${toolchain.jdk.version}</version>
+ </jdk>
+ </toolchains>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>toolchain</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
@@ -346,9 +398,9 @@
</requireMavenVersion>
<!-- The earliest JVM version we verify builds for via ASF
Jenkins -->
<requireJavaVersion>
- <version>[${java.min.version},)</version>
+
<version>[${hbase.unsafe.and.protobuf.java.version},)</version>
<message>Java is out of date.
- HBase requires at least version ${java.min.version} of the JDK to properly
build from source.
+ HBase requires at least version ${hbase.unsafe.and.protobuf.java.version} of
the JDK to properly build from source.
See the reference guide on building for more information:
http://hbase.apache.org/book.html#build</message>
</requireJavaVersion>
<bannedDependencies>
@@ -519,28 +571,65 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
- <configuration>
- <rules>
- <enforceBytecodeVersion>
- <maxJdkVersion>${compileSource}</maxJdkVersion>
- <ignoreClasses>
- <ignoreClass>module-info</ignoreClass>
-
<ignoreClass>**.glassfish.jersey.internal.jsr166.SubmissionPublisher*</ignoreClass>
-
<ignoreClass>**.glassfish.jersey.internal.jsr166.JerseyFlowSubscriber*</ignoreClass>
- </ignoreClasses>
- <ignoreOptionals>true</ignoreOptionals>
- <ignoredScopes>
- <ignoredScope>test</ignoredScope>
- </ignoredScopes>
- <message>HBase has unsupported dependencies.
- HBase requires that all dependencies be compiled with version
${compileSource} or earlier
+ <executions>
+ <!-- JDK 8 enforcement for all modules except jetty-12-plus* -->
+ <execution>
+ <id>enforce-jdk8-bytecode</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <phase>verify</phase>
+ <configuration>
+ <rules>
+ <enforceBytecodeVersion>
+
<maxJdkVersion>${hbase.unsafe.and.protobuf.java.version}</maxJdkVersion>
+ <ignoreClasses>
+ <ignoreClass>module-info</ignoreClass>
+
<ignoreClass>**.glassfish.jersey.internal.jsr166.SubmissionPublisher*</ignoreClass>
+
<ignoreClass>**.glassfish.jersey.internal.jsr166.JerseyFlowSubscriber*</ignoreClass>
+ </ignoreClasses>
+ <ignoreOptionals>true</ignoreOptionals>
+ <ignoredScopes>
+ <ignoredScope>test</ignoredScope>
+ </ignoredScopes>
+ <message>HBase has unsupported dependencies.
+ hbase-unsafe requires to be compiled with version 1.8
of the JDK to properly build from source. You appear to be using a newer
dependency. You can use
either "mvn -version" or "mvn enforcer:display-info" to verify what version
is active.
Non-release builds can temporarily build with a newer JDK version by setting
the
'compileSource' property (eg. mvn -DcompileSource=1.8 clean
package).</message>
- </enforceBytecodeVersion>
- </rules>
- </configuration>
+ </enforceBytecodeVersion>
+ </rules>
+ <skip>${skipJdk8BytecodeCheck}</skip>
+ </configuration>
+ </execution>
+ <!-- JDK 17 enforcement jetty-12-plus* modules only-->
+ <execution>
+ <id>enforce-jdk17-bytecode</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <phase>verify</phase>
+ <configuration>
+ <rules>
+ <enforceBytecodeVersion>
+ <maxJdkVersion>${java.version}</maxJdkVersion>
+ <ignoreClasses>
+ <ignoreClass>module-info</ignoreClass>
+ </ignoreClasses>
+ <ignoreOptionals>true</ignoreOptionals>
+ <ignoredScopes>
+ <ignoredScope>test</ignoredScope>
+ </ignoredScopes>
+ <message>Some modules require JDK 17 bytecode
compatibility.
+ For example, Jetty 12 modules (hbase-shaded-jetty-12-plus-*) require
dependencies compiled with JDK 17.
+ These modules are intended for HBase 3.x which supports JDK 17+.</message>
+ </enforceBytecodeVersion>
+ </rules>
+ <skip>${skipJdk17BytecodeCheck}</skip>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>