redhat-developer / redhat-developer/vscode-java

Custom gradle configurations are not properly picked up

Open
#4,039 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

Details

We have a module which generates JOOQ sources and compiles them into java classes.
The module also contains some classes under a/src/main/java which help to produce the JOOQ sources as part of the compileJava task.
So we have something like this in our A module:

val generatedDbDataJar: Configuration by configurations.creating {
    isCanBeConsumed = true
    isCanBeResolved = false
    extendsFrom(configurations["implementation"], configurations["runtimeOnly"])
}

And in our B module we have something like this which consumes it:

    implementation(project(mapOf("path" to ":A")))
    implementation(project(mapOf("path" to ":A", "configuration" to "generatedDbDataJar")))

This setup works absolutely fine if you run ./gradlew build, in Eclipse and in IntelliJ.
However, in Cursor or VSCode the setup above does not work and the produced classes are not recognized in module B and are showing as "missing" classes in the IDE.

It looks to us like this is a bug, unless there's a specific configuration for this case?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two-module setup with module A's generatedDbDataJar configuration and module B's project dependencies, then compare ./gradlew build with the VS Code or Cursor import. Trace how the Java extension handles custom Gradle configurations and verify that generated classes from A are resolved in B; done means those classes are recognized without IDE errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
build-system, developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.