vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Custom gradle configurations are not properly picked up

Open steve-todorov opened this issue 11 months ago • 0 comments

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?

steve-todorov avatar May 07 '25 18:05 steve-todorov