redhat-developer / redhat-developer/vscode-java

Dependency with scope test in gradle falls into the main classpath

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

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

Gradle
主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
11

説明

[provide a description of the issue]

Environment
  • Operating System: MacOs
  • JDK version: 17
  • Visual Studio Code version: 1.93.1
  • Java extension version: v1.34.0
Steps To Reproduce

The gradle project. If there is a dependency on another module in a multi-module project with scope test, then this dependency falls into the main classpath.

Current Result

In build.gradle.kts

  testImplementation(project(":backend:core:model"))
  testImplementation(project(":backend:core:ports"))

In .classpath of this module

	<classpathentry kind="src" path="/ports">
		<attributes>
			<attribute name="gradle.buildServer" value="true"/>
		</attributes>
	</classpathentry>
		<classpathentry kind="src" path="/model">
		<attributes>
			<attribute name="gradle.buildServer" value="true"/>
		</attributes>
	</classpathentry>
Expected Result

In .classpath of this module

	<classpathentry kind="src" path="/ports">
		<attributes>
			<attribute name="test" value="true"/>
			<attribute name="gradle.buildServer" value="true"/>
		</attributes>
	</classpathentry>
		<classpathentry kind="src" path="/model">
		<attributes>
			<attribute name="test" value="true"/>
			<attribute name="gradle.buildServer" value="true"/>
		</attributes>
	</classpathentry>
Additional Informations

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

マルチモジュールの Gradle プロジェクトから始め、生成された .classpath エントリと併せて build.gradle.kts を調べます。testImplementation 依存関係の動作を再現し、その後、影響を受けるソースエントリに属性 test=true が付与され、gradle.buildServer=true が維持されることを確認します。

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

評価

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

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

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