Skip to content

Commit ec2b775

Browse files
committed
Updated spring boot version to support 3.4.3 and spring cloud to 2024.0.0
1 parent 9349064 commit ec2b775

File tree

29 files changed

+185
-89
lines changed

29 files changed

+185
-89
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
/.idea/
1+
*.*
22
/Status
3+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Basic skeleton for Spring Boot Microservices. It includes spring security for ba
1616

1717
- Locate the docker directory from the root directory and run docker compose to startup the containers
1818
```
19-
cd docker && docker-compose up --build
19+
cd docker && docker compose up --build
2020
```
2121
![Docker Compose Build](https://github.com/Nasruddin/spring-boot-based-microservices/blob/master/images/docker-compose.png?raw=true)
2222

api/pom.xml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>2.6.6</version>
8+
<version>3.4.3</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>io.javatab.microservices.api</groupId>
1212
<artifactId>api</artifactId>
1313
<version>1.0.0</version>
14+
<packaging>jar</packaging>
1415
<name>api</name>
1516
<description>Demo project for Spring Boot</description>
1617
<properties>
@@ -41,11 +42,18 @@
4142
<build>
4243
<plugins>
4344
<plugin>
44-
<groupId>org.springframework.boot</groupId>
45-
<artifactId>spring-boot-maven-plugin</artifactId>
46-
<configuration>
47-
<classifier>exec</classifier>
48-
</configuration>
45+
<groupId>org.springframework.boot</groupId>
46+
<artifactId>spring-boot-maven-plugin</artifactId>
47+
<version>3.4.3</version> <!-- Match your Spring Boot version -->
48+
<executions>
49+
<execution>
50+
<id>repackage</id>
51+
<phase>none</phase>
52+
<goals>
53+
<goal>repackage</goal>
54+
</goals>
55+
</execution>
56+
</executions>
4957
</plugin>
5058
</plugins>
5159
</build>

api/src/test/java/io/javatab/microservices/api/ApiApplicationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.junit.jupiter.api.Test;
44
import org.springframework.boot.test.context.SpringBootTest;
55

6-
@SpringBootTest
6+
@SpringBootTest()
77
class ApiApplicationTests {
88

99
@Test

create-project.bash

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mkdir spring-boot-based-microservices
44
cd spring-boot-based-microservices
55

66
spring init \
7-
--boot-version=2.5.2 \
7+
--boot-version=3.4.3 \
88
--build=maven \
99
--java-version=17 \
1010
--packaging=jar \
@@ -16,7 +16,7 @@ spring init \
1616
student-service
1717

1818
spring init \
19-
--boot-version=2.5.2 \
19+
--boot-version=3.4.3 \
2020
--build=maven \
2121
--java-version=17 \
2222
--packaging=jar \
@@ -28,7 +28,7 @@ spring init \
2828
course-service
2929

3030
spring init \
31-
--boot-version=2.5.2 \
31+
--boot-version=3.4.3 \
3232
--build=maven \
3333
--java-version=17 \
3434
--packaging=jar \
@@ -40,7 +40,7 @@ spring init \
4040
vote-service
4141

4242
spring init \
43-
--boot-version=2.5.2 \
43+
--boot-version=3.4.3 \
4444
--build=maven \
4545
--java-version=17 \
4646
--packaging=jar \
@@ -52,7 +52,7 @@ spring init \
5252
search-service
5353

5454
spring init \
55-
--boot-version=2.5.2 \
55+
--boot-version=3.4.3 \
5656
--build=maven \
5757
--java-version=17 \
5858
--packaging=jar \

docker/docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '2.1'
2-
31
services:
42
course:
53
build: ../microservices/course-service

images/build.png

452 KB
Loading

images/docker-compose.png

45.7 KB
Loading

images/docker-ps.png

388 KB
Loading
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# stage 1
22
# Start with a base image containing Java runtime
3-
# TODO :: Upgrade to slim jre version for 17 once available
4-
FROM openjdk:17-alpine as builder
3+
FROM eclipse-temurin:17-jre-alpine as builder
54
WORKDIR application
65
ARG JAR_FILE=target/*.jar
76
COPY ${JAR_FILE} application.jar
87
RUN java -Djarmode=layertools -jar application.jar extract
98

109
# the second stage of our build will copy the extracted layers
11-
FROM openjdk:17-alpine
10+
FROM eclipse-temurin:17-jre-alpine
1211
WORKDIR application
12+
# Copy extracted layers into the correct locations
1313
COPY --from=builder application/dependencies/ ./
1414
COPY --from=builder application/spring-boot-loader/ ./
1515
COPY --from=builder application/snapshot-dependencies/ ./
1616
COPY --from=builder application/application/ ./
1717

1818
EXPOSE 8080
1919

20-
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
20+
ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"]

0 commit comments

Comments
 (0)