Skip to content

Commit

Permalink
[PF-2979] Upgrade Janitor to Spring Boot 3 (#171)
Browse files Browse the repository at this point in the history
* WIP: first pass at Janitor Spring Boot 3 upgrade

* More messing with dependencies, hopefully tests work now

* Maybe this will fix tests

* More tests and spotless

* Fix code smells

* Latest TCL

* Downgrade reactor-core library to work with Azure Relay

* Longer wait

* PR feedback
  • Loading branch information
rtitle authored Jan 5, 2024
1 parent 4194982 commit df3381b
Show file tree
Hide file tree
Showing 29 changed files with 788 additions and 544 deletions.
107 changes: 47 additions & 60 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// Build Script Classpath
buildscript {
ext {
springBootVersion = '3.1.7'
springDependencyManagementVersion = '1.1.4'
}
}

plugins {
id 'idea'
id 'jacoco'
Expand All @@ -10,7 +18,8 @@ plugins {
id 'de.undercouch.download' version '5.2.1'
id 'org.hidetake.swagger.generator' version '2.19.2'
id 'org.sonarqube' version '4.0.0.2929'
id 'org.springframework.boot' version '2.7.17'
id "org.springframework.boot" version "${springBootVersion}"
id "io.spring.dependency-management" version "${springDependencyManagementVersion}"
}

allprojects {
Expand Down Expand Up @@ -54,63 +63,72 @@ repositories {
}

dependencies {
ext {
jerseyVersion = '2.35'
springVersion = '2.7.17'
}
// Common utils
implementation group: 'org.apache.commons', name: 'commons-dbcp2', version: '2.9.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation group: 'org.apache.commons', name: 'commons-pool2', version: '2.11.1'
implementation group: 'org.apache.commons', name: 'commons-dbcp2'
implementation group: 'org.apache.commons', name: 'commons-lang3'
implementation group: 'org.apache.commons', name: 'commons-pool2'

// Spring
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jdbc', version: springVersion
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springVersion
annotationProcessor group: 'org.springframework.boot', name: 'spring-boot-configuration-processor', version: springVersion
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jdbc'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
annotationProcessor group: 'org.springframework.boot', name: 'spring-boot-configuration-processor'

// Misc. Services
implementation group: 'org.webjars', name: 'webjars-locator-core', version: '0.52'
implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
implementation group: 'jakarta.validation', name: 'jakarta.validation-api'
implementation group: 'io.projectreactor', name: 'reactor-core', version: '3.4.34'

// Google dependencies
constraints {
implementation group: 'com.google.guava', name: 'guava', version: '31.1-jre' // '-jre' for Java 8 or higher
}
implementation platform('com.google.cloud:libraries-bom:26.0.0') // use common bom

implementation group: 'com.google.auto.value', name: 'auto-value-annotations', version: '1.9'
implementation group: 'com.google.cloud', name: 'google-cloud-billing', version: '2.3.0'
implementation group: 'com.google.cloud', name: 'google-cloud-core-http', version: '2.8.0'
implementation group: 'com.google.cloud', name: 'google-cloud-pubsub', version: '1.120.0'
implementation group: 'com.google.cloud', name: 'google-cloud-storage', version: '2.9.2'
implementation group: 'com.google.cloud', name: 'google-cloud-iamcredentials', version: '2.17.0'
implementation platform('com.google.cloud:libraries-bom:26.28.0') // use common bom
implementation group: 'com.google.auto.value', name: 'auto-value-annotations'
implementation group: 'com.google.cloud', name: 'google-cloud-pubsub'
implementation group: 'com.google.cloud', name: 'google-cloud-iamcredentials'
annotationProcessor group: 'com.google.auto.value', name: 'auto-value', version: '1.9'

// Database
implementation group: 'org.liquibase' , name: 'liquibase-core', version: '4.17.2'
implementation group: 'org.liquibase' , name: 'liquibase-core', version: '4.22.0'
runtimeOnly group: 'org.postgresql', name: 'postgresql', version: '42.5.0'

// Terra libraries
implementation group: 'bio.terra', name: 'terra-common-lib', version: '0.0.89-SNAPSHOT'
implementation group: 'bio.terra', name: 'terra-cloud-resource-lib', version: '1.2.27-SNAPSHOT'
implementation group: 'bio.terra', name: 'workspace-manager-client', version: '0.254.575-SNAPSHOT'
implementation group: 'bio.terra', name: 'terra-common-lib', version: '0.1.9-SNAPSHOT'
implementation group: 'bio.terra', name: 'terra-cloud-resource-lib', version: '1.2.30-SNAPSHOT'
implementation group: 'bio.terra', name: 'workspace-manager-client', version: '0.254.997-SNAPSHOT'

// hk2 is required to use WSM client, but not correctly exposed by the client
implementation group: 'org.glassfish.jersey.inject', name: 'jersey-hk2', version: jerseyVersion
implementation group: 'org.glassfish.jersey.inject', name: 'jersey-hk2'

// Kubernetes client
implementation group: 'io.kubernetes', name: 'client-java', version: '18.0.0'

// Metrics & Tracing
implementation group: 'io.opencensus', name: 'opencensus-exporter-stats-stackdriver', version: '0.31.1'
// OpenTelemetry
var openTelemetryVersion = '1.32.0'
implementation "io.opentelemetry:opentelemetry-api:${openTelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-sdk:${openTelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-sdk-common:${openTelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-sdk-metrics:${openTelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-exporter-logging:${openTelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-semconv:1.30.1-alpha"
implementation "io.opentelemetry.instrumentation:opentelemetry-spring-webmvc-6.0:${openTelemetryVersion}-alpha"
implementation "io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:${openTelemetryVersion}"
implementation "io.opentelemetry.instrumentation:opentelemetry-spring-boot:${openTelemetryVersion}-alpha"
implementation "io.opentelemetry:opentelemetry-exporter-prometheus:${openTelemetryVersion}-alpha"

// Google cloud open telemetry exporters
var gcpOpenTelemetryExporterVersion = '0.25.2'
implementation "com.google.cloud.opentelemetry:exporter-trace:${gcpOpenTelemetryExporterVersion}"
implementation "com.google.cloud.opentelemetry:exporter-metrics:${gcpOpenTelemetryExporterVersion}"

// Swagger deps
implementation group: 'io.swagger.core.v3', name: 'swagger-annotations', version: '2.2.2'
runtimeOnly group: 'org.webjars.npm', name: 'swagger-ui-dist', version: '3.36.2'
swaggerCodegen group: 'io.swagger.codegen.v3', name: 'swagger-codegen-cli', version: '3.0.35'
swaggerCodegen group: 'io.swagger.codegen.v3', name: 'swagger-codegen-cli', version: '3.0.47'

// Test deps
testImplementation("org.springframework.boot:spring-boot-starter-test:$springVersion") {
testImplementation 'org.awaitility:awaitility:4.2.0'
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
// Allows us to mock final classes
Expand All @@ -120,38 +138,7 @@ dependencies {
// These are not directly included, they are just constrained if they are pulled in as
// transitive dependencies.
constraints {
implementation('com.google.protobuf:protobuf-java:3.21.10')
implementation('org.yaml:snakeyaml') {
version {
strictly '1.33'
}
}
implementation('io.projectreactor.netty:reactor-netty-http:1.0.38')
implementation('com.fasterxml.jackson:jackson-bom:2.14.2')
implementation('org.bouncycastle:bcpkix-jdk15on:1.70')
implementation('org.bouncycastle:bcprov-jdk15on:1.70')
spotbugs('org.apache.bcel:bcel:6.6.1')
// TODO(PF-2299): Remove these once all dependencies are using >3.0.0. This
// is forced to version 2.1.6 here to paper over a breaking change in the
// underlying library (the move from javax.ws... to jakarta.ws... package).
implementation('jakarta.ws.rs:jakarta.ws.rs-api') {
version {
strictly '2.1.6'
}
}
implementation('org.glassfish.jersey.core:jersey-common') {
version {
strictly jerseyVersion
}
}
// slf4j-api is pulled in via TCL, Janitor cannot go to version 2.0 until
// TCL does.
implementation('org.slf4j:slf4j-api') {
version {
strictly '1.7.36'
}
}

}
}

Expand Down
Loading

0 comments on commit df3381b

Please sign in to comment.