Skip to content

Fix composite build ClassNotFoundException for KMP dependency#94

Merged
srinath-square merged 1 commit intomainfrom
srinath/fix-composite-build-kmp-resolution
Feb 9, 2026
Merged

Fix composite build ClassNotFoundException for KMP dependency#94
srinath-square merged 1 commit intomainfrom
srinath/fix-composite-build-kmp-resolution

Conversation

@srinath-square
Copy link
Collaborator

Summary

  • When the com.squareup.invert plugin is consumed via includeBuild (composite build), Gradle's plugin classpath resolution fails to select the JVM variant of the invert-models Kotlin Multiplatform library. This causes a ClassNotFoundException for TechDebtInitiative at plugin application time.
  • Fixed by explicitly requesting the jvmRuntimeElements configuration on the invert-models dependency in invert-gradle-plugin/build.gradle.kts.

Test plan

  • Verified examples/ project builds successfully with includeBuild("../") (./gradlew :invert from examples/)
  • Verified normal root build still works (./gradlew :invert-gradle-plugin:jar)
  • Verified publishToMavenLocal still works
  • Verified invert-gradle-plugin tests pass

🤖 Generated with Claude Code

When the plugin is consumed via `includeBuild`, Gradle's plugin classpath
resolution fails to select the JVM variant of the `invert-models` KMP
library, causing a ClassNotFoundException for TechDebtInitiative.
Explicitly request the `jvmRuntimeElements` configuration to resolve this.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@handstandsam handstandsam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you've validated locally, this looks okay. Thanks for the contribution!

@srinath-square srinath-square merged commit 0c6ec4f into main Feb 9, 2026
5 checks passed
@srinath-square srinath-square deleted the srinath/fix-composite-build-kmp-resolution branch February 9, 2026 19:38
@srinath-square srinath-square mentioned this pull request Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments