[ 
https://issues.apache.org/jira/browse/MDEP-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17908895#comment-17908895
 ] 

Elliotte Rusty Harold edited comment on MDEP-715 at 12/30/24 3:43 PM:
----------------------------------------------------------------------

See https://github.com/apache/maven-changes-plugin/pull/105

Briefly, a project can fix this by matching the Hamcrest version to the JUnit 
version. That is, do not upgrade hamcrest to 3.0 but stick with 1.3.

That said, this case is not reported well by the dependecny analyzer and we 
should do better here.


was (Author: elharo):
See https://github.com/apache/maven-changes-plugin/pull/105

Briefly, a project can fix this by matching the Hamcrest version to the JUnit 
version. That is, do not upgrade hamcrest to 3.0 but stick with 1.3.

> Hamcrest used and unused
> ------------------------
>
>                 Key: MDEP-715
>                 URL: https://issues.apache.org/jira/browse/MDEP-715
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>          Components: analyze
>            Reporter: Elliotte Rusty Harold
>            Priority: Major
>              Labels: S2, intern
>
> This is something I've seen when analyzing several Maven plugins. For 
> example, maven-shared-utils circa July 20, 2020:
>  
> [WARNING] Used undeclared dependencies found:
> [WARNING] org.hamcrest:hamcrest:jar:2.2:test
> [WARNING] org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.0.0.M2a:test
> [WARNING] Unused declared dependencies found:
> [WARNING] org.hamcrest:hamcrest-core:jar:2.2:test
> [WARNING] org.apache.maven:maven-core:jar:3.1.0:test
> [WARNING] org.codehaus.plexus:plexus-container-default:jar:2.1.0:provided
>  
> Easy fix, right? don't declare org.hamcrest:hamcrest-core:jar:2.2:test and 
> instead declare org.hamcrest:hamcrest:jar:2.2:test
>  
> But when I do that:
>  
> [WARNING] Used undeclared dependencies found:
> [WARNING] org.hamcrest:hamcrest-core:jar:1.3:test
> [WARNING] org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.0.0.M2a:test
> [WARNING] Unused declared dependencies found:
> [WARNING] org.hamcrest:hamcrest:jar:2.2:test
> [WARNING] org.apache.maven:maven-core:jar:3.1.0:test
> [WARNING] org.codehaus.plexus:plexus-container-default:jar:2.1.0:provided
>  
> Figure out what's going on here and fix it. Is hamcrest-core needed and used 
> or not? is hamcrest needed and used or not? Be consistent.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to