Skip to content

Commit f6b522b

Browse files
authored
Dependency updates and apply Sonatype Scan Gradle Plugin (#2264)
* core 4.7.9 * aws sdk v2 2.29.39 * use jetty version defined in servlet jetty * logging 1.5.1 * protect against NPE in log statement * add sonatype scan gradle plugin * define version in libs.versions.toml * sonatype 2.8.3 * only for java 17 * add env variables
1 parent fa39bf5 commit f6b522b

File tree

6 files changed

+37
-6
lines changed

6 files changed

+37
-6
lines changed

.github/workflows/gradle.yml

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
PREDICTIVE_TEST_SELECTION: "${{ github.event_name == 'pull_request' && 'true' || 'false' }}"
3131
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
OSS_INDEX_USERNAME: ${{ secrets.OSS_INDEX_USERNAME }}
34+
OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }}
3335
steps:
3436
# https://github.com/actions/virtual-environments/issues/709
3537
- name: "🗑 Free disk space"
@@ -58,6 +60,12 @@ jobs:
5860
run: |
5961
[ -f ./setup.sh ] && ./setup.sh || [ ! -f ./setup.sh ]
6062
63+
- name: "🚔 Sonatype Scan"
64+
id: sonatypescan
65+
if: matrix.java == '17'
66+
run: |
67+
./gradlew ossIndexAudit --no-parallel
68+
6169
- name: "🛠 Build with Gradle"
6270
id: gradle
6371
run: |

aws-service-discovery/src/main/java/io/micronaut/discovery/aws/servicediscovery/registration/ServiceRegistrationStatusTask.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void run() {
7272
GetOperationResponse result = serviceDiscoveryClient.getOperation(
7373
GetOperationRequest.builder().operationId(operationId).build()
7474
);
75-
LOG.info("Service registration for operation {} resulted in {}", operationId, result.operation().status());
75+
LOG.info("Service registration for operation {} resulted in {}", operationId, result == null || result.operation() == null ? null : result.operation().status());
7676
if (result.operation().status() == OperationStatus.FAIL || result.operation().status() == OperationStatus.SUCCESS) {
7777
registered = true; // either way we are done
7878
if (result.operation().status() == OperationStatus.FAIL) {

buildSrc/build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ dependencies {
1111
implementation libs.javapoet
1212
implementation libs.gradle.micronaut
1313
implementation libs.gradle.kotlin
14-
}
14+
implementation(libs.sonatype.scan)
15+
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
plugins {
22
id "io.micronaut.build.internal.aws-base"
33
id "io.micronaut.build.internal.module"
4+
id("org.sonatype.gradle.plugins.scan")
45
}
6+
String ossIndexUsername = System.getenv("OSS_INDEX_USERNAME") ?: project.properties["ossIndexUsername"]
7+
String ossIndexPassword = System.getenv("OSS_INDEX_PASSWORD") ?: project.properties["ossIndexPassword"]
8+
boolean sonatypePluginConfigured = ossIndexUsername != null && ossIndexPassword != null
9+
if (sonatypePluginConfigured) {
10+
ossIndexAudit {
11+
username = ossIndexUsername
12+
password = ossIndexPassword
13+
excludeCompileOnly = true
14+
excludeCoordinates = [
15+
"org.eclipse.jetty:jetty-http:11.0.24" // no version of Jetty 11 patched https://ossindex.sonatype.org/component/pkg:maven/org.eclipse.jetty/jetty-http
16+
]
17+
}
18+
}
19+
configurations.all {
20+
resolutionStrategy {
21+
force("commons-io:commons-io:2.14.0") // first version patched https://ossindex.sonatype.org/component/pkg:maven/commons-io/commons-io
22+
}
23+
}

function-aws-api-proxy-test/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
dependencies {
66
api(mn.micronaut.http.server)
77
api(projects.micronautFunctionAwsApiProxy)
8+
implementation(platform(mnServlet.boms.jetty))
89
implementation(libs.jetty.server)
910
testImplementation(mn.micronaut.http.client)
1011
testImplementation(mn.micronaut.jackson.databind)

gradle/libs.versions.toml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
[versions]
2-
micronaut = "4.7.2"
2+
micronaut = "4.7.9"
33
micronaut-docs = "2.0.0"
44
micronaut-test = "4.5.0"
55
groovy = "4.0.22"
66
spock = "2.3-groovy-4.0"
77

88
bouncycastle = '1.70'
99
fileupload = '0.0.6'
10-
jetty = '11.0.24'
1110
logback-json-classic = '0.1.5'
1211

1312
micronaut-discovery = "4.5.0"
1413
micronaut-groovy = "4.5.0"
15-
micronaut-logging = "1.4.0"
14+
micronaut-logging = "1.5.1"
1615
micronaut-mongodb = "5.5.0"
1716
micronaut-reactor = "3.6.0"
1817
micronaut-security = "4.11.2"
@@ -35,6 +34,7 @@ micronaut-starter = "3.9.2"
3534
slf4j = "2.0.16"
3635
servlet-api = "2.5"
3736
javapoet = "1.13.0"
37+
sonatype-scan = "2.8.3"
3838

3939
# The following version should probably
4040
# be defined in Micronaut Graal but it's not shipped with a BOM yet
@@ -90,7 +90,7 @@ bouncycastle-provider = { module = 'org.bouncycastle:bcprov-jdk15on', version.re
9090
fileupload = { module = 'org.javadelight:delight-fileupload', version.ref = 'fileupload' }
9191
graal-sdk = { module = 'org.graalvm.sdk:graal-sdk', version.ref = 'graal' }
9292
jackson-afterburner = { module = 'com.fasterxml.jackson.module:jackson-module-afterburner' }
93-
jetty-server = { module = 'org.eclipse.jetty:jetty-server', version.ref = 'jetty' }
93+
jetty-server = { module = 'org.eclipse.jetty:jetty-server' }
9494
jcl-over-slf4j = { module = 'org.slf4j:jcl-over-slf4j', version.ref = 'slf4j' }
9595
junit-jupiter-engine = { module = 'org.junit.jupiter:junit-jupiter-engine' }
9696
junit-jupiter-api = { module = 'org.junit.jupiter:junit-jupiter-api' }
@@ -115,6 +115,8 @@ managed-awssdk-secretsmanager = { module = 'software.amazon.awssdk:secretsmanage
115115
managed-jcl-over-slf4j = { module = 'org.slf4j:jcl-over-slf4j', version.ref = 'slf4j' }
116116

117117
servlet-api = { module = 'javax.servlet:servlet-api', version.ref = 'servlet-api' }
118+
sonatype-scan = { module = "org.sonatype.gradle.plugins:scan-gradle-plugin", version.ref = "sonatype-scan" }
119+
118120
# Gradle
119121

120122
gradle-micronaut = { module = "io.micronaut.gradle:micronaut-gradle-plugin", version.ref = "micronaut-gradle-plugin" }

0 commit comments

Comments
 (0)