Skip to content

Commit

Permalink
Sabi 139 - Refactored to favor Mapstruts (#140)
Browse files Browse the repository at this point in the history
fixes #139  
sabi-139 Refactoring Task: Replacing manual mapping by introducing mapstruts
  • Loading branch information
StefanSchubert authored Nov 1, 2023
1 parent 9376fc1 commit 21580f7
Show file tree
Hide file tree
Showing 49 changed files with 798 additions and 521 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: macOS-12
runs-on: macos-latest

strategy:
fail-fast: false
Expand All @@ -36,10 +36,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 19
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '19'
java-version: '21'
distribution: 'corretto'
# maven repo cache save and restore
- uses: actions/cache@v3
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ on:
jobs:
build:

runs-on: macOS-12
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 19
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '19'
java-version: '21'
distribution: 'corretto'
# maven repo cache save and restore
- uses: actions/cache@v3
Expand All @@ -40,14 +40,14 @@ jobs:
run: cd devops/GenericPiMetricsEndpoint; mvn -B compile --file pom.xml
test:

runs-on: macOS-12
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 19
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '19'
java-version: '21'
distribution: 'corretto'
# maven repo cache save and restore
- uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion captcha/captcha-service.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Will be deployed aside of the jar, to set the memory options
# as the spring-boot-maven-plugin ignores the jvmArguments Option
export JAVA_OPTS="-Djava.io.tmpdir=/var/captcha/tmp -XX:-UsePerfData -XX:+UseG1GC -Xmx81m -Xms64m"
export JAVA_OPTS="-Djava.io.tmpdir=/var/captcha/tmp -XX:-UsePerfData -XX:+UseZGC -XX:+ZGenerational -Xmx81m -Xms64m"
10 changes: 5 additions & 5 deletions captcha/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- Taking care to have all spring dependencies right. -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.1</version>
<version>3.1.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -41,14 +41,14 @@


<properties>
<java.version>17</java.version>
<java.version>21</java.version>
<log4j2.version>2.20.0</log4j2.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<springdoc.openapiv2.version>2.1.0</springdoc.openapiv2.version>
<micrometer.prometheus.version>1.11.2</micrometer.prometheus.version>
<springdoc.openapiv2.version>2.2.0</springdoc.openapiv2.version>
<micrometer.prometheus.version>1.11.4</micrometer.prometheus.version>
<junit.version>4.13.2</junit.version>
<owasp.plugin.version>8.3.1</owasp.plugin.version>
<owasp.plugin.version>8.4.0</owasp.plugin.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion devops/GenericPiMetricsEndpoint/pimetric-service.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Will be deployed aside of the jar, to set the memory options
# as the spring-boot-maven-plugin ignores the jvmArguments Option
export JAVA_OPTS="-Xmx96m -Xms32m -XX:+UseG1GC"
export JAVA_OPTS="-Xmx96m -Xms32m -XX:+UseG1GC -XX:MaxMetaspaceSize=64m"
37 changes: 30 additions & 7 deletions devops/GenericPiMetricsEndpoint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- Taking care to have all spring dependencies right. -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.0</version>
<version>3.1.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand Down Expand Up @@ -43,12 +43,11 @@
</developers>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<micrometer.prometheus.version>1.11.2</micrometer.prometheus.version>
<java.version>21</java.version>
<lombok.version>1.18.30</lombok.version>
<micrometer.prometheus.version>1.11.5</micrometer.prometheus.version>
<pimetric.version>1.0</pimetric.version>
</properties>

Expand Down Expand Up @@ -80,7 +79,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
<version>${lombok.version}</version>
</dependency>

</dependencies>
Expand All @@ -91,10 +90,20 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<release>${java.version}</release>
<encoding>UTF-8</encoding>
<annotationProcessorPaths>
<path>
<!-- Process lombok annotations found in included libraries.
Required e.g. for sabi-boundary.
-->
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
Expand All @@ -107,6 +116,20 @@
<executable>true</executable>
</configuration>
</plugin>
<plugin>
<!-- This will check for newer version on dependencies which are
controlled by version property variables -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>display-property-updates</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
2 changes: 1 addition & 1 deletion devops/sabi_docker_sdk/captcha/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base container with amazon corretto
FROM amazoncorretto:19.0.0-al2
FROM amazoncorretto:21-alpine

# Copy Captcha executable jar. You need to replace the jar from the assets dir after a new build
# copyjars.sh will do it for you
Expand Down
2 changes: 1 addition & 1 deletion devops/sabi_docker_sdk/captcha/Dockerfile_ARM
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This dockerfile is used by developers who are not running on a intel, but on an ARM CPU architecture (like MacBook M1)

# Base container with amazon corretto which contains an arm64 build
FROM arm64v8/amazoncorretto:19.0.0-al2
FROM arm64v8/amazoncorretto:21-alpine

# Copy Captcha executable jar. You need to replace the jar from the assets dir after a new build
# copyjars.sh will do it for you
Expand Down
10 changes: 5 additions & 5 deletions devops/sabi_docker_sdk/docker-compose-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
depends_on:
- db
flyway:
image: flyway/flyway:9.8.1
image: flyway/flyway:9.22
platform: linux/arm64
command: -url=jdbc:mariadb://db:3306/sabi -defaultSchema=sabi -schemas=sabi -user=sabiapp -password=sabi123 -connectRetries=60 baseline migrate
volumes:
Expand All @@ -40,7 +40,7 @@ services:
depends_on:
- db
db:
image: mariadb:10.9.4
image: mariadb:11.1
platform: linux/arm64/v8
environment:
- MYSQL_ROOT_PASSWORD=SuperDooper
Expand All @@ -54,7 +54,7 @@ services:
- "3306:3306"
# To check what emails will be send and for being able to test the registration workflow
fakeSMTP:
image: gessnerfl/fake-smtp-server:1.10.2
image: gessnerfl/fake-smtp-server:2.1.2
platform: linux/arm64
environment:
- server.port=5080
Expand All @@ -68,7 +68,7 @@ services:
- "5080:5080"
# Monitoring Sample with Prometheus Grafana
grafana:
image: grafana/grafana:9.1.7
image: grafana/grafana:10.1.2
platform: linux/arm64
volumes:
- ./grafanaData:/var/lib/grafana
Expand All @@ -79,7 +79,7 @@ services:
depends_on:
- prometheus
prometheus:
image: prom/prometheus:v2.39.0
image: prom/prometheus:v2.47.0
platform: linux/arm64
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
Expand Down
10 changes: 5 additions & 5 deletions devops/sabi_docker_sdk/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
depends_on:
- db
flyway:
image: flyway/flyway:9.8.1
image: flyway/flyway:9.22
platform: linux/amd64
command: -url=jdbc:mariadb://db:3306/sabi -defaultSchema=sabi -schemas=sabi -user=sabiapp -password=sabi123 -connectRetries=60 baseline migrate
volumes:
Expand All @@ -36,7 +36,7 @@ services:
depends_on:
- db
db:
image: mariadb:10.9.4
image: mariadb:11.1
platform: linux/amd64
environment:
- MYSQL_ROOT_PASSWORD=SuperDooper
Expand All @@ -49,7 +49,7 @@ services:
ports:
- "3306:3306"
fakeSMTP:
image: gessnerfl/fake-smtp-server:1.10.2
image: gessnerfl/fake-smtp-server:2.1.2
platform: linux/amd64
environment:
- server.port=5080
Expand All @@ -63,7 +63,7 @@ services:
- "5080:5080"
# Monitoring Sample with Prometheus Grafana
grafana:
image: grafana/grafana:9.1.7
image: grafana/grafana:10.1.2
platform: linux/amd64
volumes:
- ./grafanaData:/var/lib/grafana
Expand All @@ -74,7 +74,7 @@ services:
depends_on:
- prometheus
prometheus:
image: prom/prometheus:v2.39.0
image: prom/prometheus:v2.47.0
platform: linux/amd64
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
Expand Down
Binary file modified devops/sabi_docker_sdk/grafanaData/grafana.db
Binary file not shown.
2 changes: 1 addition & 1 deletion devops/sabi_docker_sdk/sabi-backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base container with amazon corretto
FROM amazoncorretto:18.0.2
FROM amazoncorretto:21-alpine

# Copy sabis executable jar. You need to replace the jar from the assets dir after a new build
# copyjars.sh will do it for you
Expand Down
2 changes: 1 addition & 1 deletion devops/sabi_docker_sdk/sabi-backend/Dockerfile_ARM
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This dockerfile is used by developers who are not running on a intel, but on an ARM CPU architecture (like MacBook M1)

# Base container with amazon corretto which contains an arm64 build
FROM arm64v8/amazoncorretto:19.0.0-al2
FROM arm64v8/amazoncorretto:21-alpine

# Copy sabis executable jar. You need to replace the jar from the assets dir after a new build
# copyjars.sh will do it for you
Expand Down
16 changes: 8 additions & 8 deletions sabi-boundary/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>de.bluewhale</groupId>
<artifactId>sabi-boundary</artifactId>
<version>1.2.2</version>
<version>1.2.3</version>
<packaging>jar</packaging>
<description>
Contains the DTOs and Utility classes which will be used by the server and client module.
Expand All @@ -35,18 +35,18 @@
</developers>

<properties>
<java.version>17</java.version>
<lombok.version>1.18.26</lombok.version>
<java.version>21</java.version>
<lombok.version>1.18.30</lombok.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<hibernate.validator.version>5.1.0.Final</hibernate.validator.version>
<aspectj.version>1.5.4</aspectj.version>
<springdoc.openapiv2.version>2.1.0</springdoc.openapiv2.version>
<owasp.plugin.version>8.3.1</owasp.plugin.version>
<springdoc.openapiv2.version>2.2.0</springdoc.openapiv2.version>
<owasp.plugin.version>8.4.0</owasp.plugin.version>
<maven.war.plugin.version>4.0.0-M2</maven.war.plugin.version>
<maven.clean.plugin.version>3.2.0</maven.clean.plugin.version>
<maven.site.plugin.version>4.0.0-M4</maven.site.plugin.version>
<maven.compiler.plugin.version>3.10.1</maven.compiler.plugin.version>
<maven.clean.plugin.version>3.3.1</maven.clean.plugin.version>
<maven.site.plugin.version>4.0.0-M9</maven.site.plugin.version>
<maven.compiler.plugin.version>3.11.0</maven.compiler.plugin.version>
<buildhelper.maven.plugin.version>3.3.0</buildhelper.maven.plugin.version>

</properties>
Expand Down
8 changes: 4 additions & 4 deletions sabi-database/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<java.version>21</java.version>
<flyway.version>9.10.1</flyway.version>
<mariadb.client.version>3.1.0</mariadb.client.version>
<maven.compile.plugin.version>3.10.1</maven.compile.plugin.version>
<owasp.plugin.version>8.3.1</owasp.plugin.version>
<maven.compiler.plugin.version>3.11.0</maven.compiler.plugin.version>
<owasp.plugin.version>8.4.0</owasp.plugin.version>
<!-- Uncomment those or place them into your maven settings.xml in an own profile as I won't
checkin those secrets for stage and production
<mariadb.schema>sabi</mariadb.schema>
Expand Down Expand Up @@ -116,7 +116,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compile.plugin.version}</version>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<release>${java.version}</release>
<encoding>${project.build.sourceEncoding}</encoding>
Expand Down
Loading

0 comments on commit 21580f7

Please sign in to comment.