From bd5b447322ac9ce3ce5f89bcb7981ab023c34126 Mon Sep 17 00:00:00 2001 From: Sean Busbey Date: Sat, 26 Mar 2022 11:02:08 -0500 Subject: [PATCH] HBASE-26871 shaded mapreduce and shaded byo-hadoop client artifacts contain no classes (#4279) - revert poms for both modules - add a test to the shaded artifact validation that checks for java classes Signed-off-by: Andrew Purtell --- .../ensure-jars-have-correct-contents.sh | 4 + .../hbase-shaded-client-byo-hadoop/pom.xml | 294 +++++---- hbase-shaded/hbase-shaded-mapreduce/pom.xml | 614 ++++++++++-------- .../ensure-jars-have-correct-contents.sh | 4 + 4 files changed, 506 insertions(+), 410 deletions(-) diff --git a/hbase-shaded/hbase-shaded-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh b/hbase-shaded/hbase-shaded-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh index 3e0d73fea62..fbc48d11f2c 100644 --- a/hbase-shaded/hbase-shaded-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh +++ b/hbase-shaded/hbase-shaded-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh @@ -114,6 +114,10 @@ declare -i bad_artifacts=0 declare -a bad_contents for artifact in "${artifact_list[@]}"; do bad_contents=($(jar tf "${artifact}" | grep -v -E "${allowed_expr}" || true)) + class_count=$(jar tf "${artifact}" | grep -c -E '\.class$' || true) + if [ ${#bad_contents[@]} -eq 0 ] && [ "${class_count}" -lt 1 ]; then + bad_contents=("The artifact contains no java class files.") + fi if [ ${#bad_contents[@]} -gt 0 ]; then echo "[ERROR] Found artifact with unexpected contents: '${artifact}'" echo " Please check the following and either correct the build or update" diff --git a/hbase-shaded/hbase-shaded-client-byo-hadoop/pom.xml b/hbase-shaded/hbase-shaded-client-byo-hadoop/pom.xml index 5c699583fab..b575b53e577 100644 --- a/hbase-shaded/hbase-shaded-client-byo-hadoop/pom.xml +++ b/hbase-shaded/hbase-shaded-client-byo-hadoop/pom.xml @@ -1,6 +1,6 @@ + xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - 4.0.0 - - hbase-shaded - org.apache.hbase - 2.6.0-SNAPSHOT - .. - - hbase-shaded-client-byo-hadoop - Apache HBase - Shaded - Client - - - - org.apache.maven.plugins - maven-site-plugin - - true - - - - - maven-assembly-plugin - - true - - - - org.apache.maven.plugins - maven-shade-plugin - - - - - - org.apache.hadoop - hadoop-auth - provided - - + 4.0.0 + + hbase-shaded + org.apache.hbase + 2.6.0-SNAPSHOT + .. + + hbase-shaded-client-byo-hadoop + Apache HBase - Shaded - Client + + + + org.apache.maven.plugins + maven-site-plugin + + true + + + + + maven-assembly-plugin + + true + + + + org.apache.maven.plugins + maven-shade-plugin + + + + + + org.apache.hbase + hbase-client + + - + - - hadoop-2.0 - - + + hadoop-2.0 + + - - !hadoop.profile - - - - - org.apache.hadoop - hadoop-auth - provided - - - org.apache.hadoop - hadoop-common - provided - - - org.codehaus.jackson - jackson-jaxrs - 1.9.13 - provided - - - org.codehaus.jackson - jackson-mapper-asl - - - org.codehaus.jackson - jackson-core-asl - - - - - org.codehaus.jackson - jackson-xc - 1.9.13 - provided - - - org.codehaus.jackson - jackson-mapper-asl - - - org.codehaus.jackson - jackson-core-asl - - - - - + !hadoop.profile + + + + + org.apache.hadoop + hadoop-auth + provided + + + org.apache.hadoop + hadoop-common + provided + + + org.codehaus.jackson + jackson-jaxrs + 1.9.13 + provided + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-core-asl + + + + + org.codehaus.jackson + jackson-xc + 1.9.13 + provided + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-core-asl + + + + + - - hadoop-3.0 - - - hadoop.profile - 3.0 - - - - - org.apache.hadoop - hadoop-auth - provided - - - org.apache.hadoop - hadoop-common - provided - - - org.codehaus.jackson - jackson-jaxrs - 1.9.13 - provided - - - org.codehaus.jackson - jackson-mapper-asl - - - org.codehaus.jackson - jackson-core-asl - - - - - org.codehaus.jackson - jackson-xc - 1.9.13 - provided - - - org.codehaus.jackson - jackson-mapper-asl - - - org.codehaus.jackson - jackson-core-asl - - - - - - + + hadoop-3.0 + + + hadoop.profile + 3.0 + + + + + org.apache.hadoop + hadoop-auth + provided + + + org.apache.hadoop + hadoop-common + provided + + + org.codehaus.jackson + jackson-jaxrs + 1.9.13 + provided + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-core-asl + + + + + org.codehaus.jackson + jackson-xc + 1.9.13 + provided + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-core-asl + + + + + + diff --git a/hbase-shaded/hbase-shaded-mapreduce/pom.xml b/hbase-shaded/hbase-shaded-mapreduce/pom.xml index 0a000a2f4d4..10d943109af 100644 --- a/hbase-shaded/hbase-shaded-mapreduce/pom.xml +++ b/hbase-shaded/hbase-shaded-mapreduce/pom.xml @@ -1,6 +1,6 @@ + xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - 4.0.0 - - hbase-shaded - org.apache.hbase - 2.6.0-SNAPSHOT - .. - - hbase-shaded-mapreduce - Apache HBase - Shaded - MapReduce - - - - org.apache.maven.plugins - maven-site-plugin - - true - - - + 4.0.0 + + hbase-shaded + org.apache.hbase + 2.6.0-SNAPSHOT + .. + + hbase-shaded-mapreduce + Apache HBase - Shaded - MapReduce + + + + org.apache.maven.plugins + maven-site-plugin + + true + + + - maven-assembly-plugin - - true - - - - org.apache.maven.plugins - maven-jar-plugin - - - + maven-assembly-plugin + + true + + + + org.apache.maven.plugins + maven-jar-plugin + + + - org/apache/hadoop/hbase/mapreduce/Driver - - - - - - org.apache.maven.plugins - maven-shade-plugin - - - - + org/apache/hadoop/hbase/mapreduce/Driver + + + + + + org.apache.maven.plugins + maven-shade-plugin + + + + - - org.apache.hadoop - hadoop-common - provided - - + + org.apache.hbase + hbase-mapreduce + + + + javax.xml.bind + jaxb-api + + + javax.ws.rs + jsr311-api + + + + javax.ws.rs + javax.ws.rs-api + + + com.sun.jersey + jersey-server + + + com.sun.jersey + jersey-client + + + com.sun.jersey + jersey-core + + + com.sun.jersey + jersey-json + + + com.sun.jersey.contribs + jersey-guice + + + + javax.servlet + javax.servlet-api + + + org.eclipse.jetty + jetty-http + + + org.eclipse.jetty + jetty-security + + + org.eclipse.jetty + jetty-server + + + org.eclipse.jetty + jetty-servlet + + + org.eclipse.jetty + jetty-util + + + org.eclipse.jetty + jetty-util-ajax + + + org.glassfish + javax.el + + + org.eclipse.jetty + jetty-webapp + + + org.glassfish.jersey.core + jersey-server + + + org.glassfish.jersey.containers + jersey-container-servlet-core + + + + org.glassfish.web + javax.servlet.jsp + + + javax.servlet.jsp + javax.servlet.jsp-api + + + + - + - - hadoop-2.0 - - + + hadoop-2.0 + + - - !hadoop.profile - - - - - org.apache.hadoop - hadoop-common - provided - - - net.java.dev.jets3t - jets3t - - - javax.servlet.jsp - jsp-api - - - org.mortbay.jetty - jetty - - - com.sun.jersey - jersey-server - - - com.sun.jersey - jersey-core - - - com.sun.jersey - jersey-json - - - javax.servlet - servlet-api - - - tomcat - jasper-compiler - - - tomcat - jasper-runtime - - - com.google.code.findbugs - jsr305 - - - - - org.apache.hadoop - hadoop-hdfs - provided - - - javax.servlet.jsp - jsp-api - - - javax.servlet - servlet-api - - - io.netty - netty - - - stax - stax-api - - - xerces - xercesImpl - - - ${hadoop-two.version} - - - org.apache.hadoop - hadoop-mapreduce-client-core - provided - - - com.google.guava - guava - - - - - org.codehaus.jackson - jackson-jaxrs - 1.9.13 - provided - - + !hadoop.profile + + + + + org.apache.hadoop + hadoop-common + provided + + + net.java.dev.jets3t + jets3t + + + javax.servlet.jsp + jsp-api + + + org.mortbay.jetty + jetty + + + com.sun.jersey + jersey-server + + + com.sun.jersey + jersey-core + + + com.sun.jersey + jersey-json + + + javax.servlet + servlet-api + + + tomcat + jasper-compiler + + + tomcat + jasper-runtime + + + com.google.code.findbugs + jsr305 + + + + + org.apache.hadoop + hadoop-hdfs + provided + + + javax.servlet.jsp + jsp-api + + + javax.servlet + servlet-api + + + io.netty + netty + + + stax + stax-api + + + xerces + xercesImpl + + + ${hadoop-two.version} + + + org.apache.hadoop + hadoop-mapreduce-client-core + provided + + + com.google.guava + guava + + + + org.codehaus.jackson - jackson-mapper-asl - - + jackson-jaxrs + 1.9.13 + provided + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-core-asl + + + + org.codehaus.jackson - jackson-core-asl - - - - - org.codehaus.jackson - jackson-xc - 1.9.13 - provided - - - org.codehaus.jackson - jackson-mapper-asl - - - org.codehaus.jackson - jackson-core-asl - - - - - org.apache.hadoop - hadoop-auth - provided - - - + jackson-xc + 1.9.13 + provided + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-core-asl + + + + + org.apache.hadoop + hadoop-auth + provided + + + - - hadoop-3.0 - - - hadoop.profile - 3.0 - - - - ${hadoop-three.version} - - - - org.apache.hadoop - hadoop-common - provided - - - org.apache.hadoop - hadoop-hdfs - provided - - - org.apache.hadoop - hadoop-auth - provided - - - org.apache.hadoop - hadoop-mapreduce-client-core - provided - - - com.google.guava - guava - - - javax.xml.bind - jaxb-api - - - javax.ws.rs - jsr311-api - - - - - org.codehaus.jackson - jackson-jaxrs - 1.9.13 - provided - - + + hadoop-3.0 + + + hadoop.profile + 3.0 + + + + ${hadoop-three.version} + + + + org.apache.hadoop + hadoop-common + provided + + + org.apache.hadoop + hadoop-hdfs + provided + + + org.apache.hadoop + hadoop-auth + provided + + + org.apache.hadoop + hadoop-mapreduce-client-core + provided + + + com.google.guava + guava + + + javax.xml.bind + jaxb-api + + + javax.ws.rs + jsr311-api + + + + org.codehaus.jackson - jackson-mapper-asl - - + jackson-jaxrs + 1.9.13 + provided + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-core-asl + + + + org.codehaus.jackson - jackson-core-asl - - - - - org.codehaus.jackson - jackson-xc - 1.9.13 - provided - - - org.codehaus.jackson - jackson-mapper-asl - - - org.codehaus.jackson - jackson-core-asl - - - - - - + jackson-xc + 1.9.13 + provided + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-core-asl + + + + + + diff --git a/hbase-shaded/hbase-shaded-with-hadoop-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh b/hbase-shaded/hbase-shaded-with-hadoop-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh index 3e0d73fea62..fbc48d11f2c 100644 --- a/hbase-shaded/hbase-shaded-with-hadoop-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh +++ b/hbase-shaded/hbase-shaded-with-hadoop-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh @@ -114,6 +114,10 @@ declare -i bad_artifacts=0 declare -a bad_contents for artifact in "${artifact_list[@]}"; do bad_contents=($(jar tf "${artifact}" | grep -v -E "${allowed_expr}" || true)) + class_count=$(jar tf "${artifact}" | grep -c -E '\.class$' || true) + if [ ${#bad_contents[@]} -eq 0 ] && [ "${class_count}" -lt 1 ]; then + bad_contents=("The artifact contains no java class files.") + fi if [ ${#bad_contents[@]} -gt 0 ]; then echo "[ERROR] Found artifact with unexpected contents: '${artifact}'" echo " Please check the following and either correct the build or update"