pmd/.travis/build-sonar.sh

21 lines
746 B
Bash
Raw Normal View History

#!/bin/bash
set -e
2017-05-20 09:55:09 +02:00
source .travis/common-functions.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
echo "Building PMD Sonar ${VERSION} on branch ${TRAVIS_BRANCH}"
if ! travis_isPush; then
echo "Not updating sonar, since this is not a push!"
exit 0
fi
#
# for java9: enable all modules.
# sonar plugin seems to need java.xml.bind module
# echo "MAVEN_OPTS='-Xms1g -Xmx1g --add-modules java.se.ee'" > ${HOME}/.mavenrc
2017-06-24 17:28:40 -03:00
# Run the build, truncate output due to Travis log limits
./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${SONAR_TOKEN} -B -V