Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
Use SonarQube.com
Browse files Browse the repository at this point in the history
Execute Maven with JDK 8, because SonarQube 5.6 requires it.
Our tests are failing with JDK 8, so use JDK 7 for tests execution.
  • Loading branch information
Godin committed Jul 24, 2016
1 parent 0611873 commit 1b6a7cc
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
15 changes: 15 additions & 0 deletions .travis-toolchains.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF8"?>
<toolchains xmlns="https://maven.apache.org/TOOLCHAINS/1.1.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
<toolchain>
<type>jdk</type>
<provides>
<id>java7</id>
<version>1.7</version>
<vendor>oracle</vendor>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/java-7-oracle</jdkHome>
</configuration>
</toolchain>
</toolchains>
13 changes: 13 additions & 0 deletions .travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -euo pipefail

if [[ ${TRAVIS_PULL_REQUEST} == 'false' && ${TRAVIS_BRANCH} == 'master' ]]
then
mvn -V -B -e \
verify -Djdk.version=1.7 --toolchains=./.travis-toolchains.xml \
sonar:sonar -Dsonar.host.url=${SONARQUBE_URL} -Dsonar.login=${SONARQUBE_TOKEN}
else
mvn -V -B -e \
verify -Djdk.version=1.7 --toolchains=./.travis-toolchains.xml
fi
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
language: java
jdk: oraclejdk8

# Skip "install" stage:
install: true

# Use container-based infrastructure:
sudo: false

script: mvn -V -B -e verify
script: bash .travis.sh
7 changes: 2 additions & 5 deletions com.mountainminds.eclemma.build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,8 @@
<jacoco.version>0.7.7.201606060606</jacoco.version>
<tycho.testArgLine>-Xmx800m</tycho.testArgLine>

<!-- Sonar -->
<sonar.skippedModules>com.mountainminds.eclemma.target,com.mountainminds.eclemma.core.test,com.mountainminds.eclemma.doc,com.mountainminds.eclemma.feature,com.mountainminds.eclemma.site</sonar.skippedModules>

<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<!-- SonarQube -->
<sonar.java.source>1.5</sonar.java.source>
<sonar.jacoco.reportPath>${project.basedir}/../target/jacoco.exec</sonar.jacoco.reportPath>
<sonar.surefire.reportsPath>../${project.artifactId}.test/target/surefire-reports/</sonar.surefire.reportsPath>
</properties>
Expand Down

0 comments on commit 1b6a7cc

Please sign in to comment.