diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh index 3fe9fd9f0a3..ec051873b0e 100755 --- a/dev-support/hbase-personality.sh +++ b/dev-support/hbase-personality.sh @@ -153,8 +153,8 @@ function personality_modules # If BUILDMODE is 'patch', for unit and compile testtypes, there is no need to run individual # modules if root is included. HBASE-18505 if [[ "${BUILDMODE}" == "full" ]] || \ - ( ( [[ "${testtype}" == unit ]] || [[ "${testtype}" == compile ]] || [[ "${testtype}" == checkstyle ]] ) && \ - [[ "${MODULES[*]}" =~ \. ]] ); then + { { [[ "${testtype}" == unit ]] || [[ "${testtype}" == compile ]] || [[ "${testtype}" == checkstyle ]]; } && \ + [[ "${MODULES[*]}" =~ \. ]]; }; then MODULES=(.) fi @@ -190,23 +190,10 @@ function personality_modules # For some reason, spotbugs on root is not working, but running on individual modules is # working. For time being, let it run on original list of CHANGED_MODULES. HBASE-19491 for module in "${CHANGED_MODULES[@]}"; do - # skip spotbugs on hbase-shell and hbase-it. hbase-it has nothing - # in src/main/java where spotbugs goes to look - # skip hbase-shaded* as there is no java code in them - # skip all modules with no java code or at least, non test java code - if [[ ${module} == hbase-shell ]]; then - continue - elif [[ ${module} == hbase-it ]]; then - continue - elif [[ ${module} == hbase-shaded* ]]; then - continue - elif [[ ${module} == hbase-build-configuration ]]; then - continue - elif [[ ${module} == hbase-checkstyle ]]; then - continue - elif [[ ${module} == hbase-resource-bundle ]]; then - continue - elif [[ ${module} == hbase-testing-util ]]; then + # skip spotbugs on any module that lacks content in `src/main/java` + if [[ "$(find "${BASEDIR}/${module}" -iname '*.java' -and -ipath '*/src/main/java/*' \ + -type f | wc -l | tr -d '[:space:]')" -eq 0 ]]; then + yetus_debug "no java files found under ${module}/src/main/java. skipping." continue else # shellcheck disable=SC2086