From c602b83282ce0123c5a2bc3d5b52f3c425307251 Mon Sep 17 00:00:00 2001 From: Philipp Pixel Date: Thu, 30 Apr 2020 09:36:22 +0200 Subject: [PATCH] Support Java 11 JDK: replace maven plugin and legacy runtime libs Cobertura is a maven plugin for test reporting. Cobertura is going to be abandoned in terms of supporting Java versions >= 8. In order to natively support Java 11 a different maven plugin was already used in the Jenkinsfile, Jacoco. Jacoco is supports Java 11 out of the box. Only the already used version needed a small upgrade to work. Additionally, some runtime libraries are no longer bundled with Java 11 (like com.sun.* or Java EE libraries). These dependencies are now added as explicit dependencies in the pom file. --- Jenkinsfile | 4 +--- pom.xml | 49 +++++++++++++++++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 29f8660e2..8022f4e39 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,18 +27,16 @@ node { archiveArtifacts artifacts: '**/target/*.jar' } - String jacoco = "org.jacoco:jacoco-maven-plugin:0.8.1" + String jacoco = "org.jacoco:jacoco-maven-plugin:0.8.5" stage('Test') { mvn "${jacoco}:prepare-agent test ${jacoco}:report" } - stage('Integration Test') { mvn "${jacoco}:prepare-agent-integration failsafe:integration-test failsafe:verify ${jacoco}:report-integration" } - stage('Static Code Analysis') { def sonarQube = new SonarQube(this, [usernamePassword: credentialsId, sonarHostUrl: "${cesUrl}/sonar"]) diff --git a/pom.xml b/pom.xml index 776cd1a43..709a44d40 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,7 @@ 1.8 + 8 UTF-8 UTF-8 @@ -25,14 +26,33 @@ 3.3.6 1.11.4 2.2.4 - 1.8.0 + 1.9.0 3.0.6.RELEASE - 2.7 + 0.8.5 + + + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.2 + + + + + org.glassfish.jaxb + jaxb-runtime + 2.3.2 + + + + com.sun.activation + jakarta.activation + 1.2.1 + org.springframework.boot @@ -120,6 +140,14 @@ spring-petclinic + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.0 + + 8 + + org.springframework.boot spring-boot-maven-plugin @@ -157,20 +185,9 @@ - org.codehaus.mojo - cobertura-maven-plugin - ${cobertura.version} - - - - - - - clean - check - - - + org.jacoco + jacoco-maven-plugin + ${jacoco.version}