diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .sonarsource.properties | 6 | ||||
-rw-r--r-- | it/pom.xml | 4 | ||||
-rw-r--r-- | it/src/test/java/com/sonar/runner/it/CacheTest.java | 10 | ||||
-rw-r--r-- | it/src/test/java/com/sonar/runner/it/JavaTest.java | 10 | ||||
-rw-r--r-- | it/src/test/java/com/sonar/runner/it/MultimoduleTest.java | 10 | ||||
-rw-r--r-- | it/src/test/java/com/sonar/runner/it/ScannerTestCase.java | 10 | ||||
-rw-r--r-- | it/src/test/java/com/sonar/runner/it/SonarScannerTestSuite.java | 10 | ||||
-rw-r--r-- | pom.xml | 9 | ||||
-rwxr-xr-x | travis.sh | 77 |
10 files changed, 73 insertions, 74 deletions
@@ -1,4 +1,3 @@ - # ---- Maven target/ dependency-reduced-pom.xml diff --git a/.sonarsource.properties b/.sonarsource.properties index 158b890..69cc7ce 100644 --- a/.sonarsource.properties +++ b/.sonarsource.properties @@ -1,6 +1,2 @@ -# Sonarsource meta data file for this project - -# Wallboard -# teamAtSonarSource drives in which wallboard the alerting will be sent -# platform , language, infra +# Wallboard used in SonarSource offices wallboard.teamAtSonarSource=platform @@ -6,7 +6,7 @@ <parent> <groupId>org.sonarsource.parent</groupId> <artifactId>parent</artifactId> - <version>23</version> + <version>26</version> <relativePath /> </parent> @@ -31,7 +31,7 @@ <dependency> <groupId>org.sonarsource.orchestrator</groupId> <artifactId>sonar-orchestrator</artifactId> - <version>3.9-SNAPSHOT</version> + <version>3.9</version> </dependency> <dependency> <groupId>junit</groupId> diff --git a/it/src/test/java/com/sonar/runner/it/CacheTest.java b/it/src/test/java/com/sonar/runner/it/CacheTest.java index 8a7d704..a226521 100644 --- a/it/src/test/java/com/sonar/runner/it/CacheTest.java +++ b/it/src/test/java/com/sonar/runner/it/CacheTest.java @@ -1,7 +1,7 @@ /* * SonarSource :: IT :: SonarQube Scanner - * Copyright (C) 2009 SonarSource - * sonarqube@googlegroups.com + * Copyright (C) 2009-2016 SonarSource SA + * mailto:contact AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -13,9 +13,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.sonar.runner.it; diff --git a/it/src/test/java/com/sonar/runner/it/JavaTest.java b/it/src/test/java/com/sonar/runner/it/JavaTest.java index 2d0c2fb..e997a8b 100644 --- a/it/src/test/java/com/sonar/runner/it/JavaTest.java +++ b/it/src/test/java/com/sonar/runner/it/JavaTest.java @@ -1,7 +1,7 @@ /* * SonarSource :: IT :: SonarQube Scanner - * Copyright (C) 2009 SonarSource - * sonarqube@googlegroups.com + * Copyright (C) 2009-2016 SonarSource SA + * mailto:contact AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -13,9 +13,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.sonar.runner.it; diff --git a/it/src/test/java/com/sonar/runner/it/MultimoduleTest.java b/it/src/test/java/com/sonar/runner/it/MultimoduleTest.java index b09ca8d..2a7ef0a 100644 --- a/it/src/test/java/com/sonar/runner/it/MultimoduleTest.java +++ b/it/src/test/java/com/sonar/runner/it/MultimoduleTest.java @@ -1,7 +1,7 @@ /* * SonarSource :: IT :: SonarQube Scanner - * Copyright (C) 2009 SonarSource - * sonarqube@googlegroups.com + * Copyright (C) 2009-2016 SonarSource SA + * mailto:contact AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -13,9 +13,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.sonar.runner.it; diff --git a/it/src/test/java/com/sonar/runner/it/ScannerTestCase.java b/it/src/test/java/com/sonar/runner/it/ScannerTestCase.java index 6f0d851..9d8e63d 100644 --- a/it/src/test/java/com/sonar/runner/it/ScannerTestCase.java +++ b/it/src/test/java/com/sonar/runner/it/ScannerTestCase.java @@ -1,7 +1,7 @@ /* * SonarSource :: IT :: SonarQube Scanner - * Copyright (C) 2009 SonarSource - * sonarqube@googlegroups.com + * Copyright (C) 2009-2016 SonarSource SA + * mailto:contact AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -13,9 +13,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.sonar.runner.it; diff --git a/it/src/test/java/com/sonar/runner/it/SonarScannerTestSuite.java b/it/src/test/java/com/sonar/runner/it/SonarScannerTestSuite.java index 8114fcd..1cb56cc 100644 --- a/it/src/test/java/com/sonar/runner/it/SonarScannerTestSuite.java +++ b/it/src/test/java/com/sonar/runner/it/SonarScannerTestSuite.java @@ -1,7 +1,7 @@ /* * SonarSource :: IT :: SonarQube Scanner - * Copyright (C) 2009 SonarSource - * sonarqube@googlegroups.com + * Copyright (C) 2009-2016 SonarSource SA + * mailto:contact AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -13,9 +13,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.sonar.runner.it; @@ -183,4 +183,13 @@ </plugin> </plugins> </build> + + <profiles> + <profile> + <id>it</id> + <modules> + <module>it</module> + </modules> + </profile> + </profiles> </project> @@ -2,11 +2,12 @@ set -euo pipefail -function installTravisTools { +function configureTravis { mkdir -p ~/.local - curl -sSL https://github.com/SonarSource/travis-utils/tarball/v21 | tar zx --strip-components 1 -C ~/.local + curl -sSL https://github.com/SonarSource/travis-utils/tarball/v23 | tar zx --strip-components 1 -C ~/.local source ~/.local/bin/install } +configureTravis function strongEcho { echo "" @@ -17,56 +18,52 @@ case "$TARGET" in CI) if [ "${TRAVIS_BRANCH}" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - strongEcho 'Build and analyze commit in master' - # this commit is master must be built and analyzed (with upload of report) - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify -Pcoverage-per-test -Dmaven.test.redirectTestOutputToFile=false -B -e -V + strongEcho 'Build, deploy and analyze master' - # Switch to java 8 as the Dory HTTPS certificate is not supported by Java 7 - export JAVA_HOME=/usr/lib/jvm/java-8-oracle - export PATH=$JAVA_HOME/bin:$PATH + SONAR_PROJECT_VERSION=`maven_expression "project.version"` + + # Do not deploy a SNAPSHOT version but the release version related to this build + set_maven_build_version $TRAVIS_BUILD_NUMBER export MAVEN_OPTS="-Xmx1G -Xms128m" - mvn sonar:sonar -B -e -V \ - -Dsonar.host.url=$SONAR_HOST_URL \ - -Dsonar.login=$SONAR_TOKEN - - - elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "$GITHUB_TOKEN" ]; then - # For security reasons environment variables are not available on the pull requests - # coming from outside repositories - # http://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests - # That's why the analysis does not need to be executed if the variable SONAR_GITHUB_OAUTH is not defined. - - strongEcho 'Build and analyze pull request' - # this pull request must be built and analyzed (without upload of report) - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify -Pcoverage-per-test -Dmaven.test.redirectTestOutputToFile=false -B -e -V - - # Switch to java 8 as the Dory HTTPS certificate is not supported by Java 7 - export JAVA_HOME=/usr/lib/jvm/java-8-oracle - export PATH=$JAVA_HOME/bin:$PATH - - mvn sonar:sonar -B -e -V \ - -Dsonar.analysis.mode=issues \ + mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \ + -Pcoverage-per-test,deploy-sonarsource \ + -Dmaven.test.redirectTestOutputToFile=false \ + -Dsonar.host.url=$SONAR_HOST_URL \ + -Dsonar.login=$SONAR_TOKEN \ + -Dsonar.projectVersion=$SONAR_PROJECT_VERSION \ + -B -e -V + + elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN-}" ]; then + strongEcho 'Build and analyze pull request, no deploy' + + # No need for Maven phase "install" as the generated JAR file does not need to be installed + # in Maven local repository. Phase "verify" is enough. + + mvn org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar \ + -Dmaven.test.redirectTestOutputToFile=false \ + -Dsonar.analysis.mode=issues \ -Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \ -Dsonar.github.repository=$TRAVIS_REPO_SLUG \ -Dsonar.github.oauth=$GITHUB_TOKEN \ -Dsonar.host.url=$SONAR_HOST_URL \ - -Dsonar.login=$SONAR_TOKEN - + -Dsonar.login=$SONAR_TOKEN \ + -B -e -V else - strongEcho 'Build, no analysis' - # Build branch, without any analysis + strongEcho 'Build, no analysis, no deploy' - # No need for Maven goal "install" as the generated JAR file does not need to be installed - # in Maven local repository - mvn verify -Dmaven.test.redirectTestOutputToFile=false -B -e -V + # No need for Maven phase "install" as the generated JAR file does not need to be installed + # in Maven local repository. Phase "verify" is enough. + + mvn verify \ + -Dmaven.test.redirectTestOutputToFile=false \ + -B -e -V fi ;; IT) - installTravisTools - if [ "${SQ_VERSION}" == "DEV" ] + if [ "${SQ_VERSION}" = "DEV" ] then build_snapshot "SonarSource/sonarqube" fi @@ -76,9 +73,7 @@ IT) cd it - build_snapshot "SonarSource/orchestrator" - - mvn -Dsonar.runtimeVersion="$SQ_VERSION" -Dmaven.test.redirectTestOutputToFile=false verify + mvn -Dsonar.runtimeVersion="$SQ_VERSION" -Dmaven.test.redirectTestOutputToFile=false verify -e -B -V ;; *) |