diff --git a/dev/scalastyle b/dev/scalastyle index 212ef900eb9b4..b555ce08b789e 100755 --- a/dev/scalastyle +++ b/dev/scalastyle @@ -17,18 +17,10 @@ # limitations under the License. # -SPARK_PROFILES=${1:-"-Pmesos -Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Phive"} +SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" -# NOTE: echo "q" is needed because SBT prompts the user for input on encountering a build file -# with failure (either resolution or compilation); the "q" makes SBT quit. -ERRORS=$(echo -e "q\n" \ - | build/sbt \ - ${SPARK_PROFILES} \ - -Pdocker-integration-tests \ - -Pkubernetes-integration-tests \ - scalastyle test:scalastyle \ - | awk '{if($1~/error/)print}' \ -) +SPARK_PROFILES=${1:-"-Pmesos -Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Phive -Pdocker-integration-tests -Pkubernetes-integration-tests"} +ERRORS=$($SCRIPT_DIR/../build/mvn $SPARK_PROFILES scalastyle:check | grep "^error file") if test ! -z "$ERRORS"; then echo -e "Scalastyle checks failed at following occurrences:\n$ERRORS" diff --git a/pom.xml b/pom.xml index e72fcd90a38d8..58c05357ef417 100644 --- a/pom.xml +++ b/pom.xml @@ -2760,7 +2760,7 @@ false true - false + true false ${basedir}/src/main/scala ${basedir}/src/test/scala