Skip to content

Dependency with scope test in gradle falls into the main classpath #3777

@Daniil-Ivanov1

Description

@Daniil-Ivanov1

[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions