Skip to content

Gradle extension causes debugger extension to not include runtimeOnly dependencies in classpath when debugging #1677

@jrussellsmyth

Description

@jrussellsmyth

Extension Name: vscode-gradle
Extension Version: 3.16.4
OS Version: devcontainer with Linux ffc491a711d0 6.6.71-0-virt #1-Alpine SMP PREEMPT_DYNAMIC 2025-01-10 14:56:02 aarch64 GNU/Linux
VSCode version: April 2025 (version 1.100)

Describe the bug
runtimeOnly gradle dependencies are not properly identified and added to debug classpath. Does not happen with vscode java debugger without gradle extension.

To Reproduce
Demo repo here

In a project with runtimeOnly dependency, with runtime discovery processes, debug using the vscode java debuger. The classpath is not set correctly and the runtime discovery will fail.

Running with gradle command line succeeds.

Demo repo includes launch config with classpath workaround.

This is particularly problematic for Spring projects with -starter style libraries that configure implementations to be loaded via jar manifests.

Expected behavior
Classpath should be set based on gradle project definition

Screenshots
If applicable, add screenshots to help explain your problem.

Output from "Gradle for Java"
nothing of interest

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