Skip to content

Commit 3396f3f

Browse files
authored
[CHK-11672][CHK-11673] Force min logback version correctly (security) (#169)
1 parent d1d689e commit 3396f3f

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,23 @@ subprojects {
7878
consoleOutput = true
7979
ruleSets = ["$rootDir/ruleset.xml"]
8080
}
81+
82+
// Needed for security. See:
83+
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/7
84+
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/6
85+
// Hopefully with spring-boot 3.4.2+ this won't be needed anymore and can be removed.
86+
configurations.configureEach {
87+
resolutionStrategy.eachDependency {details ->
88+
if (details.requested.group == 'ch.qos.logback'
89+
&& (details.requested.name == 'logback-core' || details.requested.name == 'logback-classic')
90+
) {
91+
def parse = { String v -> v.tokenize('.').collect { it.padLeft(3, '0') }.join() }
92+
def current = parse(details.requested.version)
93+
def minimum = parse('1.5.15')
94+
if (current < minimum) {
95+
details.useVersion '1.5.15'
96+
}
97+
}
98+
}
99+
}
81100
}

examples/example-spring-boot-starter-web/build.gradle

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@ plugins {
55
alias(libs.plugins.openapi.generator)
66
}
77

8-
// Needed for security. See:
9-
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/7
10-
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/6
11-
// Hopefully with spring-boot 3.4.2+ this won't be needed anymore and can be removed.
12-
dependencyManagement {
13-
dependencies {
14-
dependency 'ch.qos.logback:logback-core:1.5.15'
15-
dependency 'ch.qos.logback:logback-classic:1.5.15'
16-
}
17-
}
18-
198
dependencies {
209
implementation project(':examples:examples-common')
2110
implementation project(':spring-boot-starter:spring-boot-starter-web')

examples/example-spring-boot-starter-webflux/build.gradle

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@ plugins {
55
alias(libs.plugins.openapi.generator)
66
}
77

8-
// Needed for security. See:
9-
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/7
10-
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/6
11-
// Hopefully with spring-boot 3.4.2+ this won't be needed anymore and can be removed.
12-
dependencyManagement {
13-
dependencies {
14-
dependency 'ch.qos.logback:logback-core:1.5.15'
15-
dependency 'ch.qos.logback:logback-classic:1.5.15'
16-
}
17-
}
18-
198
dependencies {
209
implementation project(':examples:examples-common')
2110
implementation project(':spring-boot-starter:spring-boot-starter-webflux')

0 commit comments

Comments
 (0)