Skip to content

Commit

Permalink
[backend] Migration to Spring Boot v3 (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomuDeuxfois authored Jan 9, 2024
1 parent 988e25d commit b0977b8
Show file tree
Hide file tree
Showing 217 changed files with 2,108 additions and 1,606 deletions.
30 changes: 15 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
command: |
git submodule sync
git submodule update --init --recursive --jobs 8
- run:
- run:
working_directory: ~/openex/openex-front
command: yarn install
- run:
working_directory: ~/openex/openex-front
command: NODE_OPTIONS=--max-old-space-size=8096 yarn build
no_output_timeout: 30m
- run:
- run:
working_directory: ~/
command: cp -a openex openex_docker && cp -a openex openex_musl
- slack/notify:
Expand All @@ -39,15 +39,15 @@ jobs:
- openex
- openex_docker
- openex_musl

build_platform:
working_directory: ~/openex
docker:
- image: maven:3.8.7-openjdk-18
- image: maven:3.9.6-eclipse-temurin-21
steps:
- attach_workspace:
at: ~/
- run:
- run:
working_directory: ~/openex
command: mvn install -DskipTests -Pdev
- slack/notify:
Expand All @@ -64,12 +64,12 @@ jobs:
build_platform_musl:
working_directory: ~/openex_musl
docker:
- image: maven:3.8.6-eclipse-temurin-18-alpine
- image: maven:3.9.6-eclipse-temurin-21-alpine
resource_class: large
steps:
- attach_workspace:
at: ~/
- run:
- run:
working_directory: ~/openex_musl
command: mvn install -DskipTests -Pdev
- slack/notify:
Expand All @@ -86,7 +86,7 @@ jobs:
package_rolling:
working_directory: ~/openex
docker:
- image: maven:3.8.7-openjdk-18
- image: maven:3.9.6-eclipse-temurin-21
steps:
- attach_workspace:
at: ~/
Expand All @@ -108,7 +108,7 @@ jobs:
package_rolling_musl:
working_directory: ~/openex_musl
docker:
- image: maven:3.8.7-openjdk-18
- image: maven:3.9.6-eclipse-temurin-21
steps:
- attach_workspace:
at: ~/
Expand Down Expand Up @@ -214,12 +214,12 @@ jobs:
- ms-teams/report:
only_on_fail: true
webhook_url: $MS_TEAMS_WEBHOOK_URL

notify_rolling:
docker:
- image: "cimg/base:stable"
steps:
- run: sudo apt-get update -qq && sudo apt install curl
- run: sudo apt-get update -qq && sudo apt install curl
- slack/notify:
event: pass
template: basic_success_1
Expand All @@ -230,13 +230,13 @@ jobs:
docker:
- image: "cimg/base:stable"
steps:
- run: sudo apt-get update -qq && sudo apt install curl
- run: sudo apt-get update -qq && sudo apt install curl
- slack/notify:
event: pass
template: basic_success_1
- ms-teams/report:
only_on_fail: false
webhook_url: $MS_TEAMS_WEBHOOK_URL
webhook_url: $MS_TEAMS_WEBHOOK_URL

workflows:
openex:
Expand Down Expand Up @@ -290,7 +290,7 @@ workflows:
ignore: /.*/
- deploy_testing:
requires:
- docker_build_platform_rolling
- docker_build_platform_rolling
- notify_rolling:
requires:
- deploy_testing
Expand All @@ -303,4 +303,4 @@ workflows:
tags:
only: /[0-9]+(\.[0-9]+)+(\.[0-9]+)*/
branches:
ignore: /.*/
ignore: /.*/
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ steps:
commands:
- git submodule update --init --recursive
- name: api-tests
image: maven:3.8.7-openjdk-18
image: maven:3.9.6-eclipse-temurin-21
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://pgsql:5432/openex
MINIO_ENDPOINT: minio
Expand Down Expand Up @@ -66,7 +66,7 @@ steps:
commands:
- git submodule update --init --recursive
- name: api-tests
image: maven:3.8.7-openjdk-18
image: maven:3.9.6-eclipse-temurin-21
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://pgsql:5432/openex
MINIO_ENDPOINT: minio
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 18
java-version: 21
if: matrix.language == 'java-kotlin'

# Initializes the CodeQL tools for scanning.
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN yarn install
COPY openex-front /opt/openex-build/openex-front
RUN yarn build

FROM maven:3.8.7-openjdk-18 AS api-builder
FROM maven:3.9.6-eclipse-temurin-21 AS api-builder

WORKDIR /opt/openex-build/openex
COPY openex-model ./openex-model
Expand All @@ -20,7 +20,7 @@ COPY pom.xml ./pom.xml
COPY --from=front-builder /opt/openex-build/openex-front/builder/prod/build ./openex-front/builder/prod/build
RUN mvn install -DskipTests -Pdev

FROM openjdk:18-slim AS app
FROM eclipse-temurin:21-jre AS app

RUN DEBIAN_FRONTEND=noninteractive apt-get update -q && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y tini;
COPY --from=api-builder /opt/openex-build/openex/openex-api/target/openex-api.jar ./
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile_circleci
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM maven:3.8.7-openjdk-18 AS api-builder
FROM maven:3.9.6-eclipse-temurin-21 AS api-builder

WORKDIR /opt/openex-build/openex
COPY openex-model ./openex-model
Expand All @@ -10,7 +10,7 @@ COPY openex-front/builder/prod/build ./openex-front/builder/prod/build
COPY pom.xml ./pom.xml
RUN mvn install -DskipTests -Pdev

FROM openjdk:18-slim AS app
FROM eclipse-temurin:21-jre AS app

RUN ln -s /usr/bin/dpkg-split /usr/sbin/dpkg-split
RUN ln -s /usr/bin/dpkg-deb /usr/sbin/dpkg-deb
Expand Down
26 changes: 9 additions & 17 deletions openex-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

<properties>
<bcpg-jdk15on.version>1.70</bcpg-jdk15on.version>
<commons-codec.version>1.16.0</commons-codec.version>
<commons-collections4.version>4.4</commons-collections4.version>
<commons-email.version>1.5</commons-email.version>
<commons-validator.version>1.7</commons-validator.version>
Expand Down Expand Up @@ -124,7 +123,6 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<!--suppress MavenPackageUpdate -->
<version>${commons-io.version}</version>
</dependency>
<dependency>
Expand All @@ -133,9 +131,8 @@
<version>${commons-validator.version}</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${validation-api.version}</version>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
Expand All @@ -144,24 +141,22 @@
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hibernate5</artifactId>
<version>${jackson.version}</version>
<artifactId>jackson-datatype-hibernate6</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-email</artifactId>
<version>${commons-email.version}</version>
</dependency>
<!-- Waiting for migration from javax to jakarta-->
<!-- <dependency>-->
<!-- <groupId>org.apache.commons</groupId>-->
<!-- <artifactId>commons-email</artifactId>-->
<!-- <version>${commons-email.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
Expand All @@ -170,13 +165,10 @@
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>${flyway.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<!--suppress MavenPackageUpdate -->
<version>${commons-codec.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
Expand Down
6 changes: 3 additions & 3 deletions openex-api/src/main/java/io/openex/config/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.util.StdDateFormat;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import com.fasterxml.jackson.datatype.hibernate6.Hibernate6Module;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import io.swagger.v3.oas.models.ExternalDocumentation;
Expand All @@ -16,7 +16,7 @@
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.annotation.Resource;
import jakarta.annotation.Resource;

@Component
@EnableAsync
Expand All @@ -39,7 +39,7 @@ ObjectMapper openexJsonMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.setDateFormat(new StdDateFormat().withColonInTimeZone(true));
mapper.registerModule(new Hibernate5Module());
mapper.registerModule(new Hibernate6Module());
mapper.registerModule(new Jdk8Module());
mapper.registerModule(new JavaTimeModule());
return mapper;
Expand Down
Loading

0 comments on commit b0977b8

Please sign in to comment.