From 048030385d611288b35efd0f9e861072cb40e018 Mon Sep 17 00:00:00 2001 From: Tibor Blenessy Date: Thu, 18 Apr 2019 15:08:26 +0200 Subject: Update CI build to use JDK 11 --- .travis.yml | 4 +--- Jenkinsfile | 38 ++++++++++++++++++++++---------------- pom.xml | 16 +++++++++++++++- travis.sh | 4 +--- 4 files changed, 39 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index ba0ed7c..82f96a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ language: java sudo: false -install: true -jdk: -- oraclejdk8 +jdk: openjdk11 script: "./travis.sh" cache: directories: diff --git a/Jenkinsfile b/Jenkinsfile index ff92f23..3e48c64 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,8 @@ pipeline { } environment { SONARSOURCE_QA = 'true' - MAVEN_TOOL = 'Maven 3.3.x' + MAVEN_TOOL = 'Maven 3.5.x' + JDK_VERSION = 'Java 11' } stages { stage('Notify') { @@ -60,8 +61,10 @@ pipeline { label 'windows' } steps { - withMaven(maven: MAVEN_TOOL) { - sh 'mvn.cmd clean test' + withQAEnv { + withMaven(maven: MAVEN_TOOL) { + sh 'mvn.cmd clean test' + } } } } @@ -86,25 +89,28 @@ pipeline { } def runITs(String sqRuntimeVersion) { - withQAEnv { - withMaven(maven: MAVEN_TOOL) { - mavenSetBuildVersion() - dir('its') { - nodejs('NodeJS 10.4.1') { - def mvn = isUnix() ? 'mvn' : 'mvn.cmd' - sh "${mvn} ${itBuildArguments sqRuntimeVersion}" - } - } + withQAEnv { + nodejs(configId: 'npm-artifactory', nodeJSInstallationName: 'NodeJS latest') { + withMaven(maven: MAVEN_TOOL) { + mavenSetBuildVersion() + dir('its') { + def mvn = isUnix() ? 'mvn' : 'mvn.cmd' + sh "${mvn} ${itBuildArguments sqRuntimeVersion}" } + } } + } } def withQAEnv(def body) { checkout scm - withCredentials([string(credentialsId: 'ARTIFACTORY_PRIVATE_API_KEY', variable: 'ARTIFACTORY_API_KEY'), - usernamePassword(credentialsId: 'ARTIFACTORY_PRIVATE_USER', passwordVariable: 'ARTIFACTORY_PRIVATE_PASSWORD', usernameVariable: 'ARTIFACTORY_PRIVATE_USERNAME')]) { - wrap([$class: 'Xvfb']) { - body.call() + def javaHome = tool name: env.JDK_VERSION, type: 'hudson.model.JDK' + withEnv(["JAVA_HOME=${javaHome}"]) { + withCredentials([string(credentialsId: 'ARTIFACTORY_PRIVATE_API_KEY', variable: 'ARTIFACTORY_API_KEY'), + usernamePassword(credentialsId: 'ARTIFACTORY_PRIVATE_USER', passwordVariable: 'ARTIFACTORY_PRIVATE_PASSWORD', usernameVariable: 'ARTIFACTORY_PRIVATE_USERNAME')]) { + wrap([$class: 'Xvfb']) { + body.call() + } } } } diff --git a/pom.xml b/pom.xml index 11cdbf3..89cb26c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.sonarsource.parent parent - 48 + 51 org.sonarsource.css @@ -178,6 +178,20 @@ + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + + + + + + its diff --git a/travis.sh b/travis.sh index 59cadca..fb5230c 100755 --- a/travis.sh +++ b/travis.sh @@ -4,12 +4,10 @@ set -euo pipefail function configureTravis { mkdir -p ~/.local - curl -sSL https://github.com/SonarSource/travis-utils/tarball/v54 | tar zx --strip-components 1 -C ~/.local + curl -sSL https://github.com/SonarSource/travis-utils/tarball/v56 | tar zx --strip-components 1 -C ~/.local source ~/.local/bin/install } configureTravis -. installJDK8 -. ~/.local/bin/installMaven35 export DEPLOY_PULL_REQUEST=true -- cgit v1.2.3