redhat-developer / redhat-developer/vscode-java

Custom gradle configurations are not properly picked up

オープン
#4,039 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
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. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、モジュール A の generatedDbDataJar 設定とモジュール B のプロジェクト依存関係を使った 2 モジュール構成を再現し、その後 ./gradlew build と VS Code または Cursor でのインポートを比較します。Java extension がカスタム Gradle 構成をどのように処理するかを追跡し、A から生成されたクラスが B で解決されることを確認します。完了とは、それらのクラスが IDE エラーなしで認識されることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, vscode
領域
build-system, developer-experience
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。