You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2025/10/04 21:00:48 UTC
[I] Understand hamcrest-core 2.2 [maven-dependency-analyzer]
elharo opened a new issue, #251:
URL: https://github.com/apache/maven-dependency-analyzer/issues/251
### Affected version
HEAD
### Bug description
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 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Understand hamcrest-core 2.2 [maven-dependency-analyzer]
Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on issue #251:
URL: https://github.com/apache/maven-dependency-analyzer/issues/251#issuecomment-3810779310
https://github.com/apache/maven-dependency-plugin/issues/1535 is the same issue. I'm not sure which project we should fix this in, but I'm leaning toward this one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Understand hamcrest-core 2.2 [maven-dependency-analyzer]
Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz closed issue #251: Understand hamcrest-core 2.2
URL: https://github.com/apache/maven-dependency-analyzer/issues/251
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Understand hamcrest-core 2.2 [maven-dependency-analyzer]
Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz commented on issue #251:
URL: https://github.com/apache/maven-dependency-analyzer/issues/251#issuecomment-5742937792
The shim is not empty: hamcrest-core 2.2 contains `org/hamcrest/core/deprecated/HamcrestCoreIsDeprecated.class`, so a "no classes → never unused" rule would not apply to it. The two warnings appear because the pin is expressed as a `<dependency>`; with `hamcrest-core:2.2` in `<dependencyManagement>` (or excluded from junit) and `org.hamcrest:hamcrest` declared for the classes in use, neither warning fires and no analyzer change is needed. Could the plugin instead hint at that when a declared-but-unused artifact also appears transitively at another version? That'd be a maven-dependency-plugin message change, not analyzer logic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org