Skip to content

junit-dep and maven: wrong dependency scope #349

Closed
@alexeev

Description

@alexeev

The junit-dep module has the compile-scope dependency on hamcrest-core lib. I think it's wrong, since the build-in hamcrest-version appears in the classpath and can lead to conflicts. Maven configuration

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit-dep</artifactId>
  <version>4.10</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.hamcrest</groupId>
  <artifactId>hamcrest-all</artifactId>
  <version>1.2</version>
  <scope>test</scope>
</dependency>

results in Compile- and Runtime- availability of

  • junit-dep-4.10
  • hamcrest-core-1.1
  • hamcrest-all-1.2

It would be better to set the dependency-scope of hamcrest-core to "provided" in the junit-dep module. The Maven configuration above would then result in:

  • junit-dep-4.10
  • hamcrest-all-1.2

At the moment we help ourself with exclusions as a workaround, in order to get a proper Compile- and Runtime classpath.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions