Summary
Generated JVM projects using Groovy DSL fail during root build script compilation because the generated build.gradle contains Kotlin DSL plugin syntax.
Reproducer
./gradlew :cli:fatBinary
./cli/projectGenerator generate-project \
--modules 6 \
--layers 5 \
--type jvm \
--language groovy \
--shape rectangle \
--output-dir /tmp/pg-jvm-groovy
cd /tmp/pg-jvm-groovy
./gradlew build
Expected behavior
The generated Groovy DSL project builds successfully.
Actual behavior
Gradle rejects the Kotlin DSL kotlin("jvm") call in the generated Groovy plugins block.
Evidence
- JDK: OpenJDK 23.0.2 (Zulu)
- OS: macOS 26.2
- Generator command:
./cli/projectGenerator generate-project --modules 6 --layers 5 --type jvm --language groovy --shape rectangle --output-dir /tmp/pg-jvm-groovy
- Generated project command:
./gradlew build
- Error excerpt:
Build file '/tmp/pg-jvm-groovy/build.gradle' line: 2
only id(String), alias(Provider), or alias(ProviderConvertible) method calls allowed in plugins {} script block
@ line 2, column 5.
kotlin("jvm") version("2.4.0") apply false
^
The root build script is generated by BuildGradle.getJvm, and the same content is currently written for both DSLs.
Scope
Affected area:
Suggested fix or test
Render Groovy-compatible JVM root plugin syntax when the output extension is gradle. Add a focused E2E test that generates a minimal JVM Groovy project and runs ./gradlew build; also cover language=both so both generated variants are built.
Summary
Generated JVM projects using Groovy DSL fail during root build script compilation because the generated
build.gradlecontains Kotlin DSL plugin syntax.Reproducer
./gradlew :cli:fatBinary ./cli/projectGenerator generate-project \ --modules 6 \ --layers 5 \ --type jvm \ --language groovy \ --shape rectangle \ --output-dir /tmp/pg-jvm-groovy cd /tmp/pg-jvm-groovy ./gradlew buildExpected behavior
The generated Groovy DSL project builds successfully.
Actual behavior
Gradle rejects the Kotlin DSL
kotlin("jvm")call in the generated Groovypluginsblock.Evidence
./cli/projectGenerator generate-project --modules 6 --layers 5 --type jvm --language groovy --shape rectangle --output-dir /tmp/pg-jvm-groovy./gradlew buildThe root build script is generated by
BuildGradle.getJvm, and the same content is currently written for both DSLs.Scope
Affected area:
Suggested fix or test
Render Groovy-compatible JVM root plugin syntax when the output extension is
gradle. Add a focused E2E test that generates a minimal JVM Groovy project and runs./gradlew build; also coverlanguage=bothso both generated variants are built.