fix: exclude Spring from resource-server-utils transitive deps#2944
Merged
Naenyn merged 1 commit intoApr 22, 2026
Merged
Conversation
uPortal pins springVersion=4.3.30.RELEASE explicitly, but resource-server 1.5.x transitively depends on Spring 5.x. Without an exclusion, a build bumping resource-server to 1.5.x ends up with both Spring versions on the classpath and javac resolves org.springframework.web.util.UriUtils against the Spring 5 API — where encodePathSegment(String, String) no longer declares 'throws UnsupportedEncodingException'. The catch clause in uPortal-utils-core's Util.encodePathSegment() then becomes unreachable and compilation fails with: Util.java:143: error: exception UnsupportedEncodingException is never thrown in body of corresponding try statement This is exactly the CI failure on uPortal-Project#2537 (Renovate's resource-server 1.3.1 → 1.5.2 bump), and the fix originates from @Naenyn's uPortal-Project#2915 where this exclusion is part of a larger 193-file PR. Landing it independently on master unblocks uPortal-Project#2537 and any other branch bumping resource-server, without coupling to the Bootstrap/jQuery work in uPortal-Project#2915. Exclusion policy mirrors what uPortal-Project#2915 applies: - resource-server-api: exclude spring-jcl (module-level) and all slf4j - resource-server-utils: exclude all of org.springframework and all slf4j The narrower exclusion on resource-server-api reflects that it's a smaller artifact; the broader exclusion on resource-server-utils prevents the full Spring 5 web stack from riding along. Verified locally: - master + this change (resourceServerVersion=1.3.1): :uPortal-utils:uPortal-utils-core:compileJava BUILD SUCCESSFUL - master + this change + resourceServerVersion=1.5.2 (simulated): :uPortal-utils:uPortal-utils-core:compileJava BUILD SUCCESSFUL (the Util.java error goes away) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Naenyn
approved these changes
Apr 22, 2026
This was referenced Apr 22, 2026
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.
Summary
uPortal explicitly pins
springVersion=4.3.30.RELEASE, butresource-server 1.5.xtransitively depends on Spring 5.x. Without an exclusion, a build bumpingresource-serverto 1.5.x ends up with both Spring versions on the classpath; javac resolvesorg.springframework.web.util.UriUtilsagainst the Spring 5 API whereencodePathSegment(String, String)no longer declaresthrows UnsupportedEncodingException, and the catch clause inUtil.encodePathSegment()becomes unreachable:This is the CI failure blocking #2537 (Renovate's
resource-server 1.3.1 → 1.5.2bump).The fix
Two
<dependency>.excludeblocks on theresource-server-apiandresource-server-utilsdeclarations inuPortal-utils/uPortal-utils-core/build.gradle, cherry-picked verbatim from the equivalent hunk in @Naenyn's #2915 (where the same exclusion is part of a larger 193-file Bootstrap/jQuery PR):resource-server-api(onlyspring-jclmodule + allslf4j) —resource-server-apiis a smaller artifact.resource-server-utils(allorg.springframework+ allslf4j) — this is the one that drags in the full Spring 5 web stack.Landing it independently on master unblocks #2537 without coupling to the Bootstrap/jQuery work in #2915.
Test plan
Validated locally:
resourceServerVersion=1.3.1→:uPortal-utils:uPortal-utils-core:compileJava BUILD SUCCESSFUL(exclusion is benign on current master)resourceServerVersion=1.5.2(simulated by editing gradle.properties locally) →:uPortal-utils:uPortal-utils-core:compileJava BUILD SUCCESSFUL(Util.java compile error goes away)Related PRs — merge order to fully unblock resource-server 1.5.2
Util.javacompile error surfaced by Spring version clash.CheckReturnValueonLimitingTeeWriter/LimitingTeeOutputStreamthat surfaces when newer Guava comes along via resource-server 1.5.x.1.3.1 → 1.5.2bump; CI goes green once both fixes above have landed.