GH-3195 Mark new Kotlin runtime dependencies as optional#3196
Open
seonwooj0810 wants to merge 1 commit into
Open
GH-3195 Mark new Kotlin runtime dependencies as optional#3196seonwooj0810 wants to merge 1 commit into
seonwooj0810 wants to merge 1 commit into
Conversation
Resolves spring-cloud#3195 `kotlin-reflect` and `kotlinx-coroutines-reactor` were added with runtime scope but without `<optional>true</optional>`. As a result, they were transitively pulled into consumer fat jars even when the application does not use Kotlin, just like the situation that spring-cloud#3128 addressed for `kotlin-stdlib-jdk8` (which is already marked optional in this same POM). Marking both dependencies optional mirrors that prior fix and avoids forcing Java-only Spring Cloud Stream consumers to ship Kotlin runtime artifacts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Fixes #3195
Summary
kotlin-reflectandkotlinx-coroutines-reactorwere added tocore/spring-cloud-stream/pom.xml(commit 11d5fb3 "Adjusted Kotlin dependencies") with<scope>runtime</scope>but without<optional>true</optional>. As a result, Java-only Spring Cloud Stream consumers transitively pull these Kotlin artifacts into their fat jars.This mirrors the situation that #3128 addressed for
kotlin-stdlib-jdk8, which sits a few lines above in the same POM and is already marked optional. The fix is to add<optional>true</optional>to both new dependencies, matching that established precedent.Change
The two dependencies remain runtime-scoped and are still available to applications that opt in (Kotlin consumers add them explicitly, or pick them up via
spring-boot-starter-webfluxor similar). Consumers that do not use Kotlin are no longer forced to ship them.Test evidence
POM-only change — no source files touched.
./mvnw -N validateoncore/spring-cloud-stream— BUILD SUCCESS../mvnw -N help:effective-pom -Doutput=/tmp/eff-pom.xmlon the same module; resolved dependencies on the project:Skipped the full multi-module build because the change is pure POM metadata (the
optionalflag does not affect compilation or test behavior of this module — only how the dependency is propagated transitively to downstream consumers).Verification done: (1)
gh pr listfor "kotlin-reflect optional", "3195 kotlin" — no in-flight PR; (2) issue #3195 has zero comments, no self-claim; (3) confirmed fix touches POM only and follows the established<optional>true</optional>pattern set by #3128 in the same file; (4) ranmvn help:effective-pomto confirmoptional=trueresolves on both dependencies in the project view; (5) reviewed git history — commit 11d5fb3 introduced the new deps without the optional flag, and no follow-up commit fixed it.