Gradle + Kotlin: Problems with subprojects and plugins

Gradle 6.1.1
Link on stackoverflow:

I have been trying to convert my projects’ gradle files using Kotlin DSL but so far failed. All my projects are multi-project builds in Java.
I followed the plugin subproject examples here

It looks like that:

plugins {

subprojects {
    apply(plugin = "java")
    dependencies {

The java plugin does not seem to be understood in the subprojects and all the ‘implementation’ lines get an unresolved reference.

Hello this behavior is related to how kotlin dsl generates type-safe model accessors. According to current documentation:
typesafe accessors are generated for this occurrences:

Only the main project build scripts and precompiled project script plugins have type-safe model accessors. Initialization scripts, settings scripts, script plugins do not. These limitations will be removed in a future Gradle release.

so in order for this to work I use workaroud applying java plugin in root project script in plugins block and it generates the accessors, so i can use it in subprojects block also

Ok thankyou.
Do we have any idea of when will “These limitations will be removed in a future Gradle release” happen ? :slight_smile: