Skip to content

Java Gradle Plugin project created from gradle init using "new API and behavior" causes broken Gradle API dependency #1734

@ergh99

Description

@ergh99

Extension Name: vscode-gradle
Extension Version: 3.17.1 and 3.17.2025111402
OS Version: Windows 10
VSCode version: 1.106.3
Gradle: 9.2.1

Describe the bug
see redhat-developer/vscode-java#3260
Same behavior is occurring but none of the suggestions / workarounds have any effect. Only commenting out the generated line (gradlePlugin.testSourceSets.add(sourceSets["functionalTest"])) causes the import issue to be resolved.

To Reproduce
Use gradle init with the following options:

  • Type of project: 3: java-gradle-plugin
  • DSL: 2: Kotlin
  • Java target version: 21
  • Generate build using new APIs and behavior: yes

Expected behavior
The project compiles from VSCode tooling.

Screenshots
Image

Output from "Gradle for Java"
[info] [gradle-server] Gradle Server started, listening on 62094
[info] Gradle client connected to server
[info] Build file changed: c:\Users\ergh99\Code\records2schema\records2schema-gradle-plugin\plugin\build.gradle.kts
[info] Build file changed: c:\Users\ergh99\Code\records2schema\records2schema-gradle-plugin\plugin\build.gradle.kts

Does the bug still exist if you disable all other extensions?
Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions