Skip to content

Commit

Permalink
Merge pull request #196 from bcgov/feature/java17Migration
Browse files Browse the repository at this point in the history
migrate to java 17 and springboot 3
  • Loading branch information
sylar-zeyangz authored Sep 8, 2023
2 parents c4f0bca + 8868999 commit 56a18b6
Show file tree
Hide file tree
Showing 19 changed files with 96 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven-test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17
- uses: actions/cache@v1
with:
path: ~/.m2/repository
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ The sample app is a demo that shows the usage of `jrcc-access-spring-boot-starte
Running this application requires Apache Maven which in-turn has a dependency on Java. As a result, the following will need to be installed:

* mvn [Apache Maven](https://maven.apache.org/)
* Java JDK [Java SE Development Kit 8u221, Java 1.8](https://www.oracle.com/java/technologies/jdk8-downloads.html)
* Java JDK [Java SE Development Kit 8u221, Java 17](https://www.oracle.com/java/technologies/jdk8-downloads.html)

#### Notes
* Other versions of Java may not work with this project due to project restrictions and requirements.
Expand Down
39 changes: 34 additions & 5 deletions jrcc-access-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-document-api</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<version>3.1.2</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

Expand Down Expand Up @@ -66,6 +66,7 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.12.5</version>
</dependency>
<dependency>
<groupId>com.brsanthu</groupId>
Expand All @@ -75,6 +76,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -106,14 +108,41 @@
<artifactId>jackson-datatype-threetenbp</artifactId>
<version>2.8.4</version>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.2.15</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-core</artifactId>
<version>2.2.15</version>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.1</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>3.3.4</version>
<version>6.6.0</version>
<configuration>
<configHelp>false</configHelp>
<configOptions>
<useJakartaEe>true</useJakartaEe>
</configOptions>
</configuration>
<executions>
<execution>
<id>spring-boot-api</id>
Expand All @@ -138,8 +167,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
Expand Down
23 changes: 17 additions & 6 deletions jrcc-access-spring-boot-autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<version>3.1.2</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-access-spring-boot-autoconfigure</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
<name>jrcc-access-spring-boot-autoconfigure</name>
<description>Demo project for Spring Boot</description>

<properties>
<log4j2.version>2.17.1</log4j2.version>
<java.version>1.8</java.version>
<java.version>17</java.version>
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.reportPath>${project.basedir}/../target/jacoco.exec</sonar.jacoco.reportPath>
Expand All @@ -42,6 +42,7 @@
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-sftp</artifactId>
<version>5.2.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
Expand All @@ -54,6 +55,7 @@
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
<version>4.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -99,20 +101,29 @@
<dependency>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-document-access-libs</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-document-api</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.55</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<version>0.8.10</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
import jakarta.validation.Valid;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
* An interceptor for adding MDC logging info for http request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.springframework.boot.context.properties.ConfigurationProperties;

import javax.validation.constraints.Min;
import jakarta.validation.constraints.Min;

/**
* Represents the rabbitmq output plugin properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.springframework.boot.context.properties.ConfigurationProperties;

import javax.validation.constraints.Min;
import jakarta.validation.constraints.Min;

/**
* Represents the rabbitmq output plugin properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.springframework.integration.sftp.session.DefaultSftpSessionFactory;
import org.springframework.integration.sftp.session.SftpRemoteFileTemplate;

import javax.websocket.MessageHandler;
import jakarta.websocket.MessageHandler;
import java.io.File;
import java.io.InputStream;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.springframework.stereotype.Component;
import org.springframework.beans.factory.annotation.Qualifier;

import javax.websocket.MessageHandler;
import jakarta.websocket.MessageHandler;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.Resource;

import javax.validation.constraints.Min;
import jakarta.validation.constraints.Min;
import java.util.Optional;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import static org.junit.Assert.*;
import static org.mockito.Mockito.verify;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import org.junit.BeforeClass;
import org.junit.Test;

import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validation;
import jakarta.validation.Validator;
import jakarta.validation.ValidatorFactory;
import java.util.Set;

import static org.junit.Assert.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import org.junit.BeforeClass;
import org.junit.Test;

import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validation;
import jakarta.validation.Validator;
import jakarta.validation.ValidatorFactory;
import java.util.Set;

import static org.junit.Assert.assertEquals;
Expand Down
8 changes: 4 additions & 4 deletions jrcc-access-spring-boot-sample-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<version>3.1.2</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-access-spring-boot-sample-app</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
<name>jrcc-access-spring-boot-sample-app</name>
<description>Demo project for Spring Boot</description>

<properties>
<java.version>1.8</java.version>
<java.version>17</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> <!-- suppress error in eclipse https://github.com/spring-projects/spring-boot/issues/16846 -->
</properties>

Expand All @@ -37,7 +37,7 @@
<dependency>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-access-spring-boot-starter</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
</dependency>

</dependencies>
Expand Down
10 changes: 5 additions & 5 deletions jrcc-access-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<version>3.1.2</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-access-spring-boot-starter</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
<name>jrcc-access-spring-boot-starter</name>
<description>Demo project for Spring Boot</description>

<properties>
<log4j2.version>2.17.1</log4j2.version>
<java.version>1.8</java.version>
<java.version>17</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> <!-- suppress error in eclipse https://github.com/spring-projects/spring-boot/issues/16846 -->
</properties>

Expand All @@ -38,12 +38,12 @@
<dependency>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-access-spring-boot-autoconfigure</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-document-access-libs</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
</dependency>
</dependencies>

Expand Down
14 changes: 10 additions & 4 deletions jrcc-document-access-libs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>ca.bc.gov.open</groupId>
<artifactId>document-access</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
</parent>


<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-document-access-libs</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
<packaging>jar</packaging>

<name>jrcc-document-access-libs</name>
Expand All @@ -23,7 +23,7 @@
<properties>
<log4j2.version>2.17.1</log4j2.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<java.version>17</java.version>
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.reportPath>${project.basedir}/../target/jacoco.exec</sonar.jacoco.reportPath>
Expand All @@ -39,13 +39,19 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<version>0.8.10</version>
<executions>
<execution>
<goals>
Expand Down
Loading

0 comments on commit 56a18b6

Please sign in to comment.