Repository navigation
build(deps): align SLF4J API and bridges with OSHI - #7890
Merged
Aias00 merged 1 commit intoOct 21, 2026
Merged
Conversation
Signed-off-by: cloudbase-ai <22498243+cloudbase-ai@users.noreply.github.com>
Aias00
approved these changes
Oct 21, 2026
Aias00
left a comment
Contributor
There was a problem hiding this comment.
Approving. The diagnosis is correct and the fix is at the right layer.
Verified while reviewing:
shenyu-common/pom.xmldeclarescom.github.oshi:oshi-core:6.10.0with noslf4j-apiexclusion, andoshi-parent-6.10.0.pomsets<slf4j.version>2.0.17</slf4j.version>(line 94) whichoshi-corethen uses for itsslf4j-apidependency. Spring Boot'sspring-boot-dependencies3.3.1 managesslf4j-apito 2.0.13, sorequireUpperBoundDepsgenuinely fails without this change.org.slf4j:slf4j-bom:2.0.17resolves on Maven Central and manages the whole family (slf4j-apiplusjcl-over-slf4j,jul-to-slf4j,log4j-over-slf4j,slf4j-ext,slf4j-jdk14,slf4j-log4j12,slf4j-nop,slf4j-reload4j,slf4j-simple,osgi-over-slf4j,slf4j-jdk-platform-logging), so bridges stay aligned with the API instead of drifting from it.- The import sits between
netty-bomandspring-boot-dependencies, matching the existing precedence pattern and comment style in this file, so the first-wins semantics of imported BOMs gives 2.0.17 over Boot's 2.0.13. - Importing a BOM does not leak its
<properties>into this project, so the localslf4j.versionproperty cannot collide with Boot's identically named property.
Non-blocking observations:
- The PR description says "the explicit
requireUpperBoundDepscheck reproduces that conflict". The enforcer configuration in the root POM (enforce-build-requirements) only bindsrequireMavenVersionandrequireJavaVersion, so this rule is a manual invocation, not something CI enforces. Worth either rewording the description or following up with a separate PR that addsrequireUpperBoundDepspermanently — otherwise the same drift can silently reappear for the next dependency bump. - A narrower alternative would be excluding
slf4j-apifromoshi-coreinshenyu-common. I prefer the BOM as written, because it fixes the whole family in one place and does not leave a second project vulnerable to the same transitive bump, but the description could say explicitly why the exclusion path was rejected. slf4j.versionnow appears in the shared "dependency version" block and reads as if it were the project's canonical SLF4J version, whereas the project still inherits every other SLF4J-adjacent version from Boot. The inline comment on the import explains the intent; consider naming the propertyslf4j-bom.versionor repeating the "must precede Spring Boot's BOM" note next to the property itself so future editors do not "clean up" the ordering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #7679. This is the SLF4J alignment slice; #7688 explicitly leaves SLF4J outside its annotation-alignment change.
Spring Boot 3.3.1 dependency management resolves
slf4j-apito 2.0.13, below the 2.0.17 requested byshenyu-common → oshi-core:6.10.0. The explicitrequireUpperBoundDepscheck reproduces that conflict.Import the official SLF4J 2.0.17 BOM before Spring Boot's BOM, matching the existing Netty BOM precedence pattern. This aligns the API and bridges together instead of upgrading only
slf4j-api. No direct dependency is added; Logback, Spring Boot, Reactor and Enforcer configuration are unchanged. Downstream projects inheriting the ShenYu parent inherit these managed SLF4J versions unless they override them.Version rationale: 2.0.17 is the minimum version already requested by the affected dependency graph. The SLF4J compatibility FAQ documents client API compatibility and matching provider major/minor versions. The 2.0.17 release notes state that its MDC initialization changes are transparent to existing logging backends. This patch stays on the existing 2.0 API line.
Validation with Java 17 and the repository Maven wrapper:
./mvnw -B -ntp -pl shenyu-common -am org.apache.maven.plugins:maven-enforcer-plugin:3.6.3:enforce -Denforcer.rules=requireUpperBoundDeps. Before: SLF4J 2.0.13 and checker-qual 3.19.0 upper-bound errors. After: only checker-qual remains. The full command still exits 1 for that separate conflict; this PR does not claim whole-reactor dependency convergence or close [Task] Reactor dependency convergence / upper-bound alignment #7679../mvnw -B -ntp -pl shenyu-common,shenyu-admin,shenyu-bootstrap -am dependency:tree '-Dincludes=org.slf4j:*,ch.qos.logback:*' -Dverbosepassed across 161 projects. Resolved SLF4J API, JCL bridge and JUL bridge are 2.0.17; Logback classic/core remain 1.5.6. The dependency plugin reports that verbose output is unsupported, so this check concerns resolved versions../mvnw -B -ntp -pl shenyu-common -am verify -Dmaven.javadoc.skip=true -Djacoco.skip=truepassed: 515 tests, 0 failures/errors, 5 existing skips; Checkstyle and RAT passed../mvnw -B -ntp -pl shenyu-admin -am test -Dtest=DataChangedEventDispatcherTest,InstanceCheckServiceTest,InstanceInfoUtilsTest,LogUtilsTest,LoggingQueueMetricsTest -Dsurefire.failIfNoSpecifiedTests=false -Djacoco.skip=true -Dmaven.javadoc.skip=truepassed: 64 Admin tests and 17 common test executions, no failures/errors.SLF4J=2.0.17 LOGBACK=1.5.6 EVENTS=3 MDC=preserved.slf4j-api:1.7.35and Log4j 2.18.0. Docker E2E itself was not run.git diff --checkpassed. No new implementation logic or mirrored-version tests were added for this POM-only change.This does not enable hard-fail convergence rules or fix the annotation/framework conflicts tracked separately in #7679.