mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 14:55:50 +00:00
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.
This commit is contained in:
parent
1cb8440818
commit
c602b83282
2 changed files with 34 additions and 19 deletions
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
|
@ -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"])
|
||||
|
|
49
pom.xml
49
pom.xml
|
@ -18,6 +18,7 @@
|
|||
|
||||
<!-- Generic properties -->
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.release>8</maven.compiler.release>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
|
@ -25,14 +26,33 @@
|
|||
<webjars-bootstrap.version>3.3.6</webjars-bootstrap.version>
|
||||
<webjars-jquery-ui.version>1.11.4</webjars-jquery-ui.version>
|
||||
<webjars-jquery.version>2.2.4</webjars-jquery.version>
|
||||
<wro4j.version>1.8.0</wro4j.version>
|
||||
<wro4j.version>1.9.0</wro4j.version>
|
||||
<thymeleaf.version>3.0.6.RELEASE</thymeleaf.version>
|
||||
|
||||
<cobertura.version>2.7</cobertura.version>
|
||||
<jacoco.version>0.8.5</jacoco.version>
|
||||
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- API, java.xml.bind module -->
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||
<version>2.3.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Runtime, com.sun.xml.bind module -->
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>jaxb-runtime</artifactId>
|
||||
<version>2.3.2</version>
|
||||
</dependency>
|
||||
<!-- Apache CXF from Java 11 on - see https://stackoverflow.com/questions/55476331/tomcat8-5-and-openjdk11-noclassdeffounderror-could-not-initialize-class-org-apa -->
|
||||
<dependency>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>jakarta.activation</artifactId>
|
||||
<version>1.2.1</version>
|
||||
</dependency>
|
||||
<!-- Spring and Spring Boot dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -120,6 +140,14 @@
|
|||
<build>
|
||||
<finalName>spring-petclinic</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<configuration>
|
||||
<release>8</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
|
@ -157,20 +185,9 @@
|
|||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>cobertura-maven-plugin</artifactId>
|
||||
<version>${cobertura.version}</version>
|
||||
<configuration>
|
||||
<check/>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>${jacoco.version}</version>
|
||||
</plugin>
|
||||
|
||||
<!-- Spring Boot Actuator displays build-related information if a git.properties
|
||||
|
|
Loading…
Reference in a new issue