HBASE-26871 shaded mapreduce and shaded byo-hadoop client artifacts contain no classes (#4279)

- add a test to the shaded artifact validation that checks for java classes

Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
Sean Busbey 2022-03-26 11:02:08 -05:00 committed by Andrew Purtell
parent 55bc977279
commit 2af359caf0
2 changed files with 8 additions and 0 deletions

View File

@ -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"

View File

@ -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"