Skip to content

Apply Kotlin Plugin Only When Kotlin Sources Exist #235

Closed

Description

@jzheaux

SpringJavaPlugin applies org.jetbrains.kotlin.jvm when a src/{main,test,integration-test}/kotlin directory exists or the build file name ends with .kts. The .kts clause was copied from the original buildSrc logic (gh-54) and applies the Kotlin plugin to Java-only modules that happen to use a Kotlin DSL build file. The plugin also isn't a dependency of this one, so the build fails with an opaque error if the consumer doesn't have it on its classpath.

The .kts clause should be removed so Kotlin is applied only when Kotlin sources exist.

Passivity: a module with a build.gradle.kts and no Kotlin source directories will no longer get the Kotlin plugin. I found no such module in spring-security, spring-session, spring-authorization-server, or spring-ldap (no *.kts files at all), but private and commercial repositories could not be checked and should be before release.

Activity

  1. added this to the 1.1.3 milestone on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: pluginAn issue related to the Gradle plugintype: breaks-passivityA change that breaks passivity with the previous releasetype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions