Skip to content

Commit ed7fcce

Browse files
fix(deps): update dependency org.springframework.boot:spring-boot-starter-parent to v4 (#2102)
* fix(deps): update dependency org.springframework.boot:spring-boot-starter-parent to v4 * initial commit * upgrade --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Raja Kolli <rajadilipkolli@gmail.com>
1 parent 99e7da8 commit ed7fcce

File tree

15 files changed

+181
-116
lines changed

15 files changed

+181
-116
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@
3434
"forwardPorts": [4200, 8080],
3535

3636
// Use 'postCreateCommand' to run commands after the container is created.
37-
"postCreateCommand": "bash -c 'echo \"Installing dependencies...\" && cd frontend/blog-angular-ui && npm config set legacy-peer-deps true && npm install && npm install -g @angular/cli && echo \"Verifying installations...\" && ng version && java -version'",
38-
39-
// Add mount for ~/.m2 to cache Maven dependencies
40-
"mounts": [
41-
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.m2,target=/home/vscode/.m2,type=bind,consistency=cached"
42-
],
37+
"postCreateCommand": "bash -c 'echo \"Installing dependencies...\" && cd frontend/blog-angular-ui && npm install && npm install -g @angular/cli && echo \"Verifying installations...\" && ng version && java -version'",
4338

4439
// Configure tool-specific properties.
4540
// "customizations": {},

poc-algorithms/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>3.5.8</version>
9+
<version>4.0.0</version>
1010
<relativePath /> <!-- lookup parent from repository -->
1111
</parent>
1212

poc-reactive-learning/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>3.5.8</version>
9+
<version>4.0.0</version>
1010
<relativePath/> <!-- lookup parent from repository -->
1111
</parent>
1212

poc-rest-api/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55

66
<groupId>com.example.poc</groupId>
77
<artifactId>poc-spring-boot-rest</artifactId>
88
<packaging>pom</packaging>
99
<name>Spring Boot Rest Parent</name>
1010
<version>0.4.0-SNAPSHOT</version>
11-
<url>http://maven.apache.org</url>
11+
<url>https://maven.apache.org</url>
1212

1313
<modules>
1414
<module>spring-boot-rest-webmvc</module>

poc-rest-api/spring-boot-rest-webflux/pom.xml

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.springframework.boot</groupId>
99
<artifactId>spring-boot-starter-parent</artifactId>
10-
<version>3.5.8</version>
10+
<version>4.0.0</version>
1111
<relativePath/> <!-- lookup parent from repository -->
1212
</parent>
1313

@@ -37,12 +37,8 @@
3737
<artifactId>spring-boot-starter-data-r2dbc</artifactId>
3838
</dependency>
3939
<dependency>
40-
<groupId>org.liquibase</groupId>
41-
<artifactId>liquibase-core</artifactId>
42-
</dependency>
43-
<dependency>
44-
<groupId>org.springframework</groupId>
45-
<artifactId>spring-jdbc</artifactId>
40+
<groupId>org.springframework.boot</groupId>
41+
<artifactId>spring-boot-starter-liquibase</artifactId>
4642
</dependency>
4743
<dependency>
4844
<groupId>org.postgresql</groupId>
@@ -59,24 +55,19 @@
5955
<artifactId>mapstruct</artifactId>
6056
<version>${org.mapstruct.version}</version>
6157
</dependency>
62-
<dependency>
63-
<groupId>org.projectlombok</groupId>
64-
<artifactId>lombok</artifactId>
65-
<optional>true</optional>
66-
</dependency>
6758
<dependency>
6859
<groupId>org.springframework.boot</groupId>
69-
<artifactId>spring-boot-starter-test</artifactId>
60+
<artifactId>spring-boot-starter-webflux-test</artifactId>
7061
<scope>test</scope>
7162
</dependency>
7263
<dependency>
7364
<groupId>org.springframework.boot</groupId>
74-
<artifactId>spring-boot-testcontainers</artifactId>
65+
<artifactId>spring-boot-starter-data-r2dbc-test</artifactId>
7566
<scope>test</scope>
7667
</dependency>
7768
<dependency>
78-
<groupId>io.projectreactor</groupId>
79-
<artifactId>reactor-test</artifactId>
69+
<groupId>org.springframework.boot</groupId>
70+
<artifactId>spring-boot-testcontainers</artifactId>
8071
<scope>test</scope>
8172
</dependency>
8273
<dependency>
@@ -86,17 +77,17 @@
8677
</dependency>
8778
<dependency>
8879
<groupId>org.testcontainers</groupId>
89-
<artifactId>junit-jupiter</artifactId>
80+
<artifactId>testcontainers-junit-jupiter</artifactId>
9081
<scope>test</scope>
9182
</dependency>
9283
<dependency>
9384
<groupId>org.testcontainers</groupId>
94-
<artifactId>postgresql</artifactId>
85+
<artifactId>testcontainers-postgresql</artifactId>
9586
<scope>test</scope>
9687
</dependency>
9788
<dependency>
9889
<groupId>org.testcontainers</groupId>
99-
<artifactId>r2dbc</artifactId>
90+
<artifactId>testcontainers-r2dbc</artifactId>
10091
<scope>test</scope>
10192
</dependency>
10293
<dependency>
@@ -116,14 +107,6 @@
116107
<plugin>
117108
<groupId>org.springframework.boot</groupId>
118109
<artifactId>spring-boot-maven-plugin</artifactId>
119-
<configuration>
120-
<excludes>
121-
<exclude>
122-
<groupId>org.projectlombok</groupId>
123-
<artifactId>lombok</artifactId>
124-
</exclude>
125-
</excludes>
126-
</configuration>
127110
<executions>
128111
<execution>
129112
<goals>
@@ -135,28 +118,15 @@
135118
<plugin>
136119
<groupId>org.apache.maven.plugins</groupId>
137120
<artifactId>maven-compiler-plugin</artifactId>
138-
<configuration>
139-
<source>${java.version}</source> <!-- depending on your project -->
140-
<target>${java.version}</target> <!-- depending on your project -->
121+
<configuration> <!-- depending on your project --> <!-- depending on your project -->
141122
<annotationProcessorPaths>
142123
<path>
143124
<groupId>org.mapstruct</groupId>
144125
<artifactId>mapstruct-processor</artifactId>
145126
<version>${org.mapstruct.version}</version>
146127
</path>
147-
<!-- other annotation processors -->
148-
<path>
149-
<groupId>org.projectlombok</groupId>
150-
<artifactId>lombok</artifactId>
151-
<version>${lombok.version}</version>
152-
</path>
153-
<!-- This is needed when using Lombok 1.18.16 and above -->
154-
<path>
155-
<groupId>org.projectlombok</groupId>
156-
<artifactId>lombok-mapstruct-binding</artifactId>
157-
<version>0.2.0</version>
158-
</path>
159128
</annotationProcessorPaths>
129+
<release>${java.version}</release>
160130
</configuration>
161131
</plugin>
162132
<plugin>
@@ -194,7 +164,7 @@
194164
<configuration>
195165
<java>
196166
<googleJavaFormat>
197-
<version>1.25.2</version>
167+
<version>1.28.0</version>
198168
<style>AOSP</style>
199169
</googleJavaFormat>
200170
<licenseHeader>

poc-rest-api/spring-boot-rest-webflux/src/main/java/com/example/poc/reactive/config/SecurityConfig.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
/* Licensed under Apache-2.0 2021-2023 */
22
package com.example.poc.reactive.config;
33

4-
import lombok.extern.slf4j.Slf4j;
4+
import org.slf4j.Logger;
5+
import org.slf4j.LoggerFactory;
56
import org.springframework.context.annotation.Bean;
67
import org.springframework.context.annotation.Configuration;
78
import org.springframework.http.HttpMethod;
89
import org.springframework.security.authorization.AuthorizationDecision;
910
import org.springframework.security.config.web.server.ServerHttpSecurity;
10-
import org.springframework.security.core.Authentication;
1111
import org.springframework.security.core.userdetails.MapReactiveUserDetailsService;
1212
import org.springframework.security.core.userdetails.User;
1313
import org.springframework.security.core.userdetails.UserDetails;
1414
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
1515
import org.springframework.security.crypto.password.PasswordEncoder;
1616
import org.springframework.security.web.server.SecurityWebFilterChain;
17-
import org.springframework.security.web.server.authorization.AuthorizationContext;
1817
import org.springframework.security.web.server.context.NoOpServerSecurityContextRepository;
19-
import reactor.core.publisher.Mono;
2018

21-
@Configuration
22-
@Slf4j
19+
@Configuration(proxyBeanMethods = false)
2320
class SecurityConfig {
2421

22+
private static final Logger log = LoggerFactory.getLogger(SecurityConfig.class);
23+
2524
@Bean
2625
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) {
2726
var postPath = "/posts/**";
@@ -39,19 +38,22 @@ SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) {
3938
.pathMatchers(postPath)
4039
.hasRole("USER")
4140
.pathMatchers("/users/{user}/**")
42-
.access(this::currentUserMatchesPath)
41+
.access(
42+
(authentication, context) ->
43+
authentication
44+
.map(
45+
auth ->
46+
context.getVariables()
47+
.get("user")
48+
.equals(
49+
auth
50+
.getName()))
51+
.map(AuthorizationDecision::new))
4352
.anyExchange()
4453
.authenticated())
4554
.build();
4655
}
4756

48-
private Mono<AuthorizationDecision> currentUserMatchesPath(
49-
Mono<Authentication> authentication, AuthorizationContext context) {
50-
return authentication
51-
.map(a -> context.getVariables().get("user").equals(a.getName()))
52-
.map(AuthorizationDecision::new);
53-
}
54-
5557
@Bean
5658
PasswordEncoder passwordEncoder() {
5759
return PasswordEncoderFactories.createDelegatingPasswordEncoder();

poc-rest-api/spring-boot-rest-webflux/src/main/java/com/example/poc/reactive/controller/PostClassicController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import com.example.poc.reactive.entity.ReactivePost;
66
import com.example.poc.reactive.service.PostService;
77
import java.net.URI;
8-
import lombok.RequiredArgsConstructor;
98
import org.reactivestreams.Publisher;
109
import org.springframework.http.ResponseEntity;
1110
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -20,11 +19,14 @@
2019

2120
@RestController
2221
@RequestMapping("/posts")
23-
@RequiredArgsConstructor
2422
public class PostClassicController {
2523

2624
private final PostService postService;
2725

26+
public PostClassicController(PostService postService) {
27+
this.postService = postService;
28+
}
29+
2830
@GetMapping
2931
public Publisher<ReactivePost> all() {
3032
return this.postService.findAllPosts();

0 commit comments

Comments
 (0)