redhat-developer / redhat-developer/vscode-java

Custom gradle configurations are not properly picked up

未关闭
#4,039 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
2.3k
派生
546
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

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?

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先复现包含 module A 的 generatedDbDataJar configuration 和 module B 的 project dependencies 的双 module 设置,然后将 ./gradlew build 与 VS Code 或 Cursor 中的导入进行比较。追踪 Java extension 如何处理 custom Gradle configurations,并验证来自 A 的 generated classes 是否能在 B 中被 resolve;完成的标准是这些 classes 能被识别且没有 IDE 错误。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, vscode
领域
build-system, developer-experience
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。