Skip to content

Commit

Permalink
Merge pull request #3381 from navikt/feature/spring-boot-3.2
Browse files Browse the repository at this point in the history
Feature/spring boot 3.2 og gradle 8.5
  • Loading branch information
stigus authored Jan 15, 2024
2 parents c2c83a4 + 0119a5c commit fcc8311
Show file tree
Hide file tree
Showing 269 changed files with 714 additions and 740 deletions.
10 changes: 5 additions & 5 deletions apps/adresse-service/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.1.4"
id 'io.spring.dependency-management' version "1.1.3"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

Expand Down Expand Up @@ -40,7 +40,7 @@ bootJar {
dependencyManagement {
applyMavenExclusions = false
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2022.0.4'
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.0'
}
}

Expand Down Expand Up @@ -68,8 +68,8 @@ dependencies {
implementation 'org.aspectj:aspectjweaver:1.9.7'

implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.16'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.20'

testImplementation 'org.springframework.boot:spring-boot-starter-test'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 6 additions & 6 deletions apps/amelding-service/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.1.4"
id 'io.spring.dependency-management' version "1.1.3"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

Expand Down Expand Up @@ -40,7 +40,7 @@ bootJar {
dependencyManagement {
applyMavenExclusions = false
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2022.0.4'
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.0'
}
}

Expand All @@ -64,15 +64,15 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'

implementation 'org.springframework.cloud:spring-cloud-starter-vault-config'

implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config
implementation 'org.springframework.boot:spring-boot-starter-actuator'

implementation 'io.micrometer:micrometer-registry-prometheus'
implementation 'org.hibernate.validator:hibernate-validator'

implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.0.4'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.16'
implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.3.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.20'
implementation 'net.logstash.logback:logstash-logback-encoder:7.4'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ public Mono<AMelding> get(String id) {
Mono<String> accessToken = tokenExchange.exchange(consumers.getOppsummeringsdokumentService()).map(AccessToken::getTokenValue);
return oppsummeringsdokumentConsumer.get(id, accessToken).map(AMelding::new);
}
}
}
10 changes: 5 additions & 5 deletions apps/app-tilgang-analyse-service/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.1.4"
id 'io.spring.dependency-management' version "1.1.3"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

Expand Down Expand Up @@ -39,7 +39,7 @@ bootJar {
dependencyManagement {
applyMavenExclusions = false
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2022.0.4'
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.0'
}
}

Expand Down Expand Up @@ -69,8 +69,8 @@ dependencies {
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'

implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.0.4'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.16'
implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.3.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.20'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
10 changes: 5 additions & 5 deletions apps/arbeidsforhold-service/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.1.4"
id 'io.spring.dependency-management' version "1.1.3"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

Expand Down Expand Up @@ -40,7 +40,7 @@ bootJar {
dependencyManagement {
applyMavenExclusions = false
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2022.0.4'
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.0'
}
}

Expand Down Expand Up @@ -75,8 +75,8 @@ dependencies {

implementation 'io.micrometer:micrometer-registry-prometheus'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.16'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.20'

implementation 'net.logstash.logback:logstash-logback-encoder:7.4'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
10 changes: 5 additions & 5 deletions apps/batch-bestilling-service/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.1.4"
id 'io.spring.dependency-management' version "1.1.3"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

Expand Down Expand Up @@ -38,7 +38,7 @@ bootJar {
dependencyManagement {
applyMavenExclusions = false
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2022.0.4'
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.0'
}
}

Expand Down Expand Up @@ -67,8 +67,8 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'

implementation 'io.micrometer:micrometer-registry-prometheus'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.16'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.20'

implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
implementation 'org.hibernate.validator:hibernate-validator'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
27 changes: 18 additions & 9 deletions apps/brreg-stub/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id "uk.co.boothen.gradle.wsimport" version "0.21"
id 'org.springframework.boot' version "3.1.4"
id 'io.spring.dependency-management' version "1.1.3"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
id("org.openrewrite.rewrite") version("6.6.4")
}

test {
Expand Down Expand Up @@ -33,16 +34,21 @@ sonarqube {
}
}

rewrite {
activeRecipe("org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2")
}


dependencyManagement {
applyMavenExclusions = false
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2022.0.4'
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.0'

}
}

bootJar {
duplicatesStrategy(DuplicatesStrategy.INCLUDE)
archiveFileName = "app.jar"
}

Expand All @@ -62,6 +68,8 @@ repositories {

dependencies {

rewrite("org.openrewrite.recipe:rewrite-spring:5.2.0")

implementation("io.dropwizard:dropwizard-jackson:4.0.2") {
exclude group: "com.google.code.findbugs"
}
Expand All @@ -76,7 +84,6 @@ dependencies {

implementation 'org.springframework.cloud:spring-cloud-starter-vault-config'
implementation 'org.springframework.cloud:spring-cloud-vault-config-databases'
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // TODO remove legacy bootstrap config
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-validation'

Expand All @@ -90,7 +97,7 @@ dependencies {
implementation 'org.apache.cxf:cxf-rt-transports-http'
implementation 'org.apache.cxf:cxf-rt-ws-security'
implementation 'jakarta.servlet:jakarta.servlet-api'

implementation 'org.postgresql:postgresql'
implementation 'com.zaxxer:HikariCP'

Expand All @@ -99,24 +106,26 @@ dependencies {

implementation 'wsdl4j:wsdl4j'
implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
implementation 'org.springdoc:springdoc-openapi-ui:1.6.15'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.20'

implementation 'no.nav.common:auth'
implementation 'no.nav.common:util'
implementation 'no.nav.common:cxf:3.2023.10.17_06.55-4e30d96bba05'

implementation 'com.h2database:h2'
implementation "com.sun.xml.ws:jaxws-rt:4.0.2"
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'org.testcontainers:postgresql'
implementation 'jakarta.jws:jakarta.jws-api:3.0.0'

testImplementation 'junit:junit:4.13.2' //TODO upgrade to JUnit5
implementation 'jakarta.jws:jakarta.jws-api:3.0.0' //TODO upgrade to JUnit5
testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

implementation 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

testImplementation "org.junit.jupiter:junit-jupiter:5.10.1"
}
java {
toolchain {
Expand Down
2 changes: 1 addition & 1 deletion apps/brreg-stub/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package no.nav.brregstub;

import no.nav.testnav.libs.servletcore.util.VaultUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import no.nav.testnav.libs.servletcore.util.VaultUtil;


@SpringBootApplication
public class BrregApplicationLauncher {
Expand All @@ -16,4 +15,4 @@ public static void main(String[] args) {
}
SpringApplication.run(BrregApplicationLauncher.class, args);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public ClientAuthentication clientAuthentication() {
}
var token = System.getProperty(TOKEN);
if (StringUtils.isBlank(token)) {
throw new IllegalArgumentException(String.format("Påkrevet property '%s' er ikke satt.", TOKEN));
throw new IllegalArgumentException("Påkrevet property '%s' er ikke satt.".formatted(TOKEN));
}
return new TokenAuthentication(System.getProperty(TOKEN));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public ResponseEntity<Map> lagreEllerOppdaterHentRolleStub(@Valid @RequestBody R
@GetMapping("/{orgnr}")
public ResponseEntity<RsOrganisasjon> hentGrunndata(@NotNull @PathVariable Integer orgnr) {
var grunndata = service.hentRolle(orgnr)
.orElseThrow(() -> new NotFoundException(String.format("Kunne ikke finne roller for :%s",
orgnr)));
.orElseThrow(() -> new NotFoundException("Kunne ikke finne roller for :%s".formatted(
orgnr)));
return ResponseEntity.status(HttpStatus.OK).body(grunndata);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public ResponseEntity<RolleoversiktTo> lagreEllerOppdaterRolleoversikt(@Valid @R
@GetMapping
public ResponseEntity<RolleoversiktTo> hentRolleoversikt(@NotNull @RequestHeader(name = "Nav-Personident") String ident) {
var grunndata = service.hentRolleoversiktV1(ident)
.orElseThrow(() -> new NotFoundException(String.format("Kunne ikke finne person med fnr:%s",
ident)));
.orElseThrow(() -> new NotFoundException("Kunne ikke finne person med fnr:%s".formatted(
ident)));
return ResponseEntity.status(HttpStatus.OK).body(grunndata);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public ResponseEntity<RsRolleoversikt> lagreEllerOppdaterRolleoversikt(@Valid @R
@GetMapping
public ResponseEntity<RsRolleoversikt> hentRolleoversikt(@NotNull @RequestHeader(name = "Nav-Personident") String ident) {
var grunndata = service.hentRolleoversiktV2(ident)
.orElseThrow(() -> new NotFoundException(String.format("Kunne ikke finne person med fnr:%s", ident)));
.orElseThrow(() -> new NotFoundException("Kunne ikke finne person med fnr:%s".formatted(ident)));
return ResponseEntity.status(HttpStatus.OK).body(grunndata);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import no.nav.brregstub.tjenestekontrakter.ws.HentRolleutskriftResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
Expand All @@ -28,7 +27,6 @@ public class BrregEndpoint {

private final BrregService brregService;

@Autowired
public BrregEndpoint(BrregService brregService) {
this.brregService = brregService;
}
Expand Down
Loading

0 comments on commit fcc8311

Please sign in to comment.