apache / apache/maven-dependency-plugin

Understand hamcrest-core 2.x

Open
#1,535 6 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
175
Forks
196
Avg merge
19h 30m
Merged PRs (30d)
5

Description

### Affected version

HEAD

### Bug description

```

org.hamcrest
hamcrest-core
2.2
test

```

This one's an ugly mess. It has a purpose when present to avoid introducing a transitive dependency on hamcrest-core 1.3, which can happen with JUnit 4. However, it's just a shim that contains no classes and depends on hamcrest.

This creates one of the ugly unused when included and needed when not included warning Catch-22s.

In any case we should never report hamcrest-core 2.2 as unused. It contains nothing, causes no problems, and prevents other problems even though it contributes exactly zero classes to the classpath.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or tests are named. Start by tracing the unused-dependency reporting path for dependencies that contain no classes, then inspect how hamcrest-core 2.2 is identified. Done means hamcrest-core 2.2 is not reported as unused while its protection against hamcrest-core 1.3 remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.