Skip to content

Commit 72d7033

Browse files
committed
chore(dependency): upgrade spring boot from 2.7.x to 3.0.x and spring cloud from 2021.0.x to 2022.0.x
Upgrading spring boot 2.7.18 to 3.0.13 and spring cloud 2021.0.8 to 2022.0.5. Spring cloud release 2022.0.x is compatible with spring boot 3.0.x. https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases Removing bean of WebSecurityConfigurerAdapter, as in spring security 6.0 it is no more required. spring-projects/spring-security#11923 https://www.baeldung.com/spring-security-migrate-5-to-6#2-websecurityconfigureradapter =============================================================================================== refactor(dependency): replace javax with jakarta during upgrade of spring boot 3.0.x Spring Boot 3.0 has migrated from Java EE to Jakarta EE APIs for all dependencies. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes#third-party-library-upgrades So, replacing the imports with `javax` to `jakarta`. =============================================================================================== refactor(dependency): migrate rxjava to rxjava3 during upgrade of spring boot 3.0.x Spring boot 3.x deprecated and removed rxjava, and rxjava3 has been added. So, update the dependency. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#rxjava And refactored the code to accomodate changes required by rxjava2 and rxjava3 following the changelogs. https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0 https://github.com/ReactiveX/RxJava/wiki/What%27s-different-in-3.0 ================================================================================================ refactor(util): replace SocketUtils with TestSocketUtils during upgrade of spring boot 3.0.x `org.springframework.util.SocketUtils` has been deprecated in spring framework 5.3.x and removed from 6.0. `org.springframework.test.util.TestSocketUtils` has been introduced as a replacement of `SocketUtils`. spring-projects/spring-framework#28052 spring-projects/spring-framework#28210
1 parent 83113c4 commit 72d7033

File tree

10 files changed

+21
-20
lines changed

10 files changed

+21
-20
lines changed

halyard-config/halyard-config.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies {
4040
implementation 'com.jcraft:jsch'
4141
implementation 'de.huxhorn.sulky:de.huxhorn.sulky.ulid'
4242
implementation "net.logstash.logback:logstash-logback-encoder"
43-
implementation "javax.validation:validation-api"
43+
implementation "jakarta.validation:jakarta.validation-api"
4444

4545
// TODO: add clouddriverDCOS once that's merged
4646
implementation project(':halyard-core')

halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/error/v1/ConfigNotFoundException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import com.netflix.spinnaker.halyard.core.error.v1.HalException;
2121
import com.netflix.spinnaker.halyard.core.problem.v1.Problem;
22-
import javax.servlet.http.HttpServletResponse;
22+
import jakarta.servlet.http.HttpServletResponse;
2323
import lombok.Getter;
2424

2525
/**

halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/persistentStorage/OraclePersistentStore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
import com.netflix.spinnaker.halyard.config.model.v1.node.PersistentStore;
1515
import com.netflix.spinnaker.halyard.config.model.v1.node.Secret;
1616
import com.netflix.spinnaker.halyard.config.model.v1.node.SecretFile;
17-
import javax.validation.constraints.NotNull;
18-
import javax.validation.constraints.Size;
17+
import jakarta.validation.constraints.NotNull;
18+
import jakarta.validation.constraints.Size;
1919
import lombok.Data;
2020
import lombok.EqualsAndHashCode;
2121

halyard-core/halyard-core.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies {
1515
implementation 'org.apache.commons:commons-exec'
1616
implementation 'org.apache.commons:commons-compress:1.20'
1717
implementation 'commons-io:commons-io'
18-
implementation 'io.reactivex:rxjava'
18+
implementation 'io.reactivex.rxjava3:rxjava'
1919
implementation 'com.hubspot.jinjava:jinjava:2.2.3'
2020
implementation 'org.spockframework:spock-spring'
2121
implementation 'org.yaml:snakeyaml:1.24'

halyard-core/src/main/java/com/netflix/spinnaker/halyard/core/error/v1/HalException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
import com.netflix.spinnaker.halyard.core.problem.v1.Problem;
2121
import com.netflix.spinnaker.halyard.core.problem.v1.ProblemBuilder;
2222
import com.netflix.spinnaker.halyard.core.problem.v1.ProblemSet;
23+
import jakarta.servlet.http.HttpServletResponse;
2324
import java.util.ArrayList;
2425
import java.util.Collections;
2526
import java.util.List;
26-
import javax.servlet.http.HttpServletResponse;
2727
import lombok.Getter;
2828

2929
/** This is the exception class that needs to be thrown by all validators. */

halyard-core/src/main/java/com/netflix/spinnaker/halyard/core/job/v1/JobExecutorLocal.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package com.netflix.spinnaker.halyard.core.job.v1;
1919

20+
import io.reactivex.rxjava3.core.Scheduler;
21+
import io.reactivex.rxjava3.schedulers.Schedulers;
2022
import java.io.ByteArrayOutputStream;
2123
import java.io.IOException;
2224
import java.io.InputStream;
@@ -26,9 +28,6 @@
2628
import lombok.Data;
2729
import lombok.extern.slf4j.Slf4j;
2830
import org.apache.commons.exec.*;
29-
import rx.Scheduler;
30-
import rx.functions.Action0;
31-
import rx.schedulers.Schedulers;
3231

3332
@Slf4j
3433
public class JobExecutorLocal extends JobExecutor {
@@ -64,9 +63,9 @@ public String startJob(
6463
scheduler
6564
.createWorker()
6665
.schedule(
67-
new Action0() {
66+
new Runnable() {
6867
@Override
69-
public void call() {
68+
public void run() {
7069
PumpStreamHandler pumpStreamHandler = new PumpStreamHandler(stdOut, stdErr, stdIn);
7170
CommandLine commandLine;
7271

halyard-deploy/halyard-deploy.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies {
2929
implementation project(':halyard-backup')
3030

3131
testImplementation 'org.spockframework:spock-core'
32-
testImplementation 'org.springframework:spring-test'
32+
implementation 'org.springframework:spring-test'
3333
testRuntimeOnly 'net.bytebuddy:byte-buddy'
3434
testRuntimeOnly 'org.objenesis:objenesis'
3535
}

halyard-deploy/src/main/java/com/netflix/spinnaker/halyard/deploy/spinnaker/v1/service/distributed/google/GoogleProviderUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
import org.apache.commons.io.IOUtils;
5959
import org.apache.commons.lang3.StringUtils;
6060
import org.apache.http.client.utils.URIBuilder;
61-
import org.springframework.util.SocketUtils;
61+
import org.springframework.test.util.TestSocketUtils;
6262

6363
@Slf4j
6464
class GoogleProviderUtils {
@@ -188,7 +188,7 @@ private static Proxy openSshTunnel(String ip, int port, String keyFile)
188188
}
189189
}
190190

191-
int localPort = SocketUtils.findAvailableTcpPort();
191+
int localPort = TestSocketUtils.findAvailableTcpPort();
192192

193193
command.clear();
194194
command.add("ssh");

halyard-web/src/main/java/com/netflix/spinnaker/halyard/config/v1/SecurityConfig.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@
1616

1717
package com.netflix.spinnaker.halyard.config.v1;
1818

19+
import org.springframework.context.annotation.Bean;
1920
import org.springframework.context.annotation.Configuration;
2021
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
21-
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
22+
import org.springframework.security.web.SecurityFilterChain;
2223

2324
@Configuration
24-
public class SecurityConfig extends WebSecurityConfigurerAdapter {
25+
public class SecurityConfig {
2526

26-
@Override
27-
public void configure(HttpSecurity http) throws Exception {
28-
http.csrf().disable().authorizeRequests().anyRequest().permitAll();
27+
@Bean
28+
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
29+
http.authorizeHttpRequests().anyRequest().permitAll().and().csrf().disable();
30+
return http.build();
2931
}
3032
}

halyard-web/src/main/java/com/netflix/spinnaker/halyard/errors/v1/HalconfigExceptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import com.netflix.spinnaker.halyard.core.DaemonResponse;
2020
import com.netflix.spinnaker.halyard.core.error.v1.HalException;
21-
import javax.servlet.http.HttpServletResponse;
21+
import jakarta.servlet.http.HttpServletResponse;
2222
import org.springframework.web.bind.annotation.ControllerAdvice;
2323
import org.springframework.web.bind.annotation.ExceptionHandler;
2424
import org.springframework.web.bind.annotation.ResponseBody;

0 commit comments

Comments
 (0)