2017-02-27 20:35:17 +01:00
|
|
|
#!/bin/bash
|
2017-05-20 10:16:29 +02:00
|
|
|
set -e
|
2017-02-27 20:35:17 +01:00
|
|
|
|
2017-05-20 09:55:09 +02:00
|
|
|
source .travis/common-functions.sh
|
2017-05-15 21:11:43 +02:00
|
|
|
|
|
|
|
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}"
|
|
|
|
|
2017-05-20 10:43:14 +02:00
|
|
|
if ! travis_isPush; then
|
2017-05-15 21:11:43 +02:00
|
|
|
echo "Not updating sonar, since this is not a push!"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2017-10-01 14:08:07 +02:00
|
|
|
#
|
|
|
|
# for java9: enable all modules.
|
|
|
|
# sonar plugin seems to need java.xml.bind module
|
2017-12-15 11:05:36 +01:00
|
|
|
# echo "MAVEN_OPTS='-Xms1g -Xmx1g --add-modules java.se.ee'" > ${HOME}/.mavenrc
|
2017-05-15 21:11:43 +02:00
|
|
|
|
2017-06-24 17:28:40 -03:00
|
|
|
# Run the build, truncate output due to Travis log limits
|
2017-11-23 20:23:31 +01:00
|
|
|
./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${SONAR_TOKEN} -B -V
|