Skip to content

Commit 484f1d5

Browse files
author
Ivan Franchin
committed
Project upgrade
- upgrade to spring-boot 3.3.5; - upgrade to Java 21; - upgrade to jib 3.4.4; - upgrade to graddle 8.10.2; - upgrade to mongo docker image 7.0.14; - upgrade to keycloak docker image 26.0.1; - update README.
1 parent b4c4d4c commit 484f1d5

File tree

9 files changed

+42
-47
lines changed

9 files changed

+42
-47
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
The goals of this project are:
44

5-
- Create a [`Spring Boot`](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/) application that manages books, called `book-service`;
5+
- Create a [`Spring Boot`](https://docs.spring.io/spring-boot/index.html) application that manages books, called `book-service`;
66
- Use [`Keycloak`](https://www.keycloak.org) as OpenID Connect Provider;
7-
- Test using [`Testcontainers`](https://www.testcontainers.org/);
7+
- Test using [`Testcontainers`](https://testcontainers.com/);
88
- Explore the utilities and annotations that `Spring Boot` provides when testing applications.
99

1010
## Proof-of-Concepts & Articles
@@ -14,8 +14,8 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
1414
## Additional Readings
1515

1616
- \[**Medium**\] [**Implementing and Securing a Simple Spring Boot REST API with Keycloak**](https://medium.com/@ivangfr/how-to-secure-a-spring-boot-app-with-keycloak-5a931ee12c5a)
17-
- \[**Medium**\] [**Implementing and Securing a Simple Spring Boot UI (Thymeleaf + RBAC) with Keycloak**](https://medium.com/spring-boot/how-to-secure-a-simple-spring-boot-ui-thymeleaf-rbac-with-keycloak-ba9f30b9cb2b)
18-
- \[**Medium**\] [**Implementing and Securing a Spring Boot GraphQL API with Keycloak**](https://medium.com/javarevisited/implementing-and-securing-a-spring-boot-graphql-api-with-keycloak-c461c86e3972)
17+
- \[**Medium**\] [**Implementing and Securing a Simple Spring Boot UI (Thymeleaf + RBAC) with Keycloak**](https://medium.com/@ivangfr/how-to-secure-a-simple-spring-boot-ui-thymeleaf-rbac-with-keycloak-ba9f30b9cb2b)
18+
- \[**Medium**\] [**Implementing and Securing a Spring Boot GraphQL API with Keycloak**](https://medium.com/@ivangfr/implementing-and-securing-a-spring-boot-graphql-api-with-keycloak-c461c86e3972)
1919
- \[**Medium**\] [**Building a Single Spring Boot App with Keycloak or Okta as IdP: Introduction**](https://medium.com/@ivangfr/building-a-single-spring-boot-app-with-keycloak-or-okta-as-idp-introduction-2814a4829aed)
2020

2121
## Application
@@ -28,9 +28,9 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
2828

2929
## Prerequisites
3030

31-
- [`Java 17+`](https://www.oracle.com/java/technologies/downloads/#java17)
31+
- [`Java 21+`](https://www.oracle.com/java/technologies/downloads/#java21)
3232
- [`Docker`](https://www.docker.com/)
33-
- [`jq`](https://stedolan.github.io/jq)
33+
- [`jq`](https://jqlang.github.io/jq/)
3434

3535
## Start Environment
3636

book-service/build.gradle

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
plugins {
2-
id 'org.springframework.boot' version '3.2.4'
3-
id 'io.spring.dependency-management' version '1.1.4'
4-
id 'com.google.cloud.tools.jib' version '3.4.1'
2+
id 'java'
3+
id 'org.springframework.boot' version '3.3.5'
4+
id 'io.spring.dependency-management' version '1.1.6'
5+
id 'com.google.cloud.tools.jib' version '3.4.4'
56
}
67

78
group = 'com.ivanfranchin'
89
version = '1.0.0'
9-
sourceCompatibility = 17
10+
11+
java {
12+
toolchain {
13+
languageVersion = JavaLanguageVersion.of(21)
14+
}
15+
}
1016

1117
configurations {
1218
compileOnly {
@@ -24,10 +30,10 @@ repositories {
2430
ext {
2531
set('mapstructVersion', '1.5.5.Final')
2632
set('lombokMapstructBindingVersion', '0.2.0')
27-
set('springdocOpenApiVersion', '2.4.0')
28-
set('keycloakVersion', '24.0.1')
33+
set('springdocOpenApiVersion', '2.6.0')
34+
set('keycloakVersion', '26.0.1')
2935
set('httpClient5Version', '5.3.1')
30-
set('jdkImageVersion', '17.0.10')
36+
set('jdkImageVersion', '21.0.4')
3137
set('dockerImagePrefix', 'ivanfranchin')
3238
}
3339

book-service/src/integration-test/java/com/ivanfranchin/bookservice/AbstractTestcontainers.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public abstract class AbstractTestcontainers {
2626

2727
@Container
2828
@ServiceConnection
29-
private static final MongoDBContainer mongoDBContainer = new MongoDBContainer("mongo:7.0.6");
29+
private static final MongoDBContainer mongoDBContainer = new MongoDBContainer("mongo:7.0.14");
3030

31-
private static final GenericContainer<?> keycloakContainer = new GenericContainer<>("quay.io/keycloak/keycloak:24.0.1");
31+
private static final GenericContainer<?> keycloakContainer = new GenericContainer<>("quay.io/keycloak/keycloak:26.0.1");
3232

3333
protected static Keycloak keycloakBookService;
3434

book-service/src/test/java/com/ivanfranchin/bookservice/repository/BookRepositoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class BookRepositoryTest {
2323

2424
@Container
2525
@ServiceConnection
26-
private static final MongoDBContainer mongoDBContainer = new MongoDBContainer("mongo:7.0.6");
26+
private static final MongoDBContainer mongoDBContainer = new MongoDBContainer("mongo:7.0.14");
2727

2828
@Autowired
2929
private MongoTemplate mongoTemplate;

gradle/wrapper/gradle-wrapper.jar

121 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
1-
#
2-
# Copyright 2012-2024 the original author or authors.
3-
#
4-
# Licensed under the Apache License, Version 2.0 (the "License");
5-
# you may not use this file except in compliance with the License.
6-
# You may obtain a copy of the License at
7-
#
8-
# https://www.apache.org/licenses/LICENSE-2.0
9-
#
10-
# Unless required by applicable law or agreed to in writing, software
11-
# distributed under the License is distributed on an "AS IS" BASIS,
12-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
# See the License for the specific language governing permissions and
14-
# limitations under the License.
15-
#
16-
171
distributionBase=GRADLE_USER_HOME
182
distributionPath=wrapper/dists
19-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
204
networkTimeout=10000
215
validateDistributionUrl=true
226
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

gradlew.bat

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
4345
%JAVA_EXE% -version >NUL 2>&1
4446
if %ERRORLEVEL% equ 0 goto execute
4547

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
48+
echo. 1>&2
49+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50+
echo. 1>&2
51+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52+
echo location of your Java installation. 1>&2
5153

5254
goto fail
5355

@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5759

5860
if exist "%JAVA_EXE%" goto execute
5961

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
62+
echo. 1>&2
63+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64+
echo. 1>&2
65+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66+
echo location of your Java installation. 1>&2
6567

6668
goto fail
6769

init-environment.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

3-
MONGO_VERSION="7.0.6"
4-
KEYCLOAK_VERSION="24.0.1"
3+
MONGO_VERSION="7.0.14"
4+
KEYCLOAK_VERSION="26.0.1"
55

66
source scripts/my-functions.sh
77

0 commit comments

Comments
 (0)