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

Thorsten Glaser commented on MDEP-753:
--------------------------------------

After finding 
[https://maven.apache.org/guides/development/guide-testing-development-plugins.html]
 I was able to test the snapshot on the 
[https://github.com/tarent/extract-tool/tree/mdep753-snapshot] branch as well.

The initial problem…
{quote}{{$ mvn -Dmaven.dependency.version=3.2.0 
dependency:analyze-only@analyse-dependency-usage}}
{{[…]}}
{{[WARNING] Non-test scoped test only dependencies found:}}
{{[WARNING]    org.springframework:spring-jdbc:jar:4.3.30.RELEASE:compile}}
{quote}
… is gone, but I have a new problem:
{quote}{{$ mvn dependency:analyze-only@analyse-dependency-usage}}
{{[…]}}
{{[WARNING] Non-test scoped test only dependencies found:}}
{{[WARNING]    
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.13.1:compile}}
{quote}
This is “correct”: {{com.fasterxml.jackson.dataformat.yaml.YAMLFactory}} is 
{{{}import{}}}ed in the tests but only used via reflection in prod because it’s 
an optional (but not marked as optional so it’s included by default, but users 
can {{<exclude>}} it and that’s supported and documented) dependency.

However, adding it as {{<ignoredUnusedDeclaredDependency>}} does not work ☹ and 
[https://maven.apache.org/plugins/maven-dependency-plugin/analyze-only-mojo.html]
 does not have anything on how to override this particular warning.

This is a *must-have* for, I hope, obvious reasons…

> Non-test dependency reported as Non-test scoped test only dependency
> --------------------------------------------------------------------
>
>                 Key: MDEP-753
>                 URL: https://issues.apache.org/jira/browse/MDEP-753
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>          Components: analyze
>    Affects Versions: 3.2.0
>            Reporter: Elliotte Rusty Harold
>            Assignee: Elliotte Rusty Harold
>            Priority: Critical
>             Fix For: 3.3.0
>
>
> Saw this when updating the google-http-java-client from 3.1.2 to 3.2.0 of the 
> plugin. I'm not immediately sure whether this is a regression:
> [INFO] --- maven-dependency-plugin:3.2.0:analyze (default-cli) @ 
> google-http-client ---
> Warning:  Non-test scoped test only dependencies found:
> Warning:     com.google.guava:guava:jar:30.1.1-android:compile
> Warning:     io.opencensus:opencensus-api:jar:0.28.0:compile
> Changing Guava to scope test breaks the build, which is expected based on the 
> code. The warning seems incorrect. 
> https://github.com/googleapis/google-http-java-client/pull/1396
> https://github.com/googleapis/google-http-java-client/pull/1396/checks?check_run_id=2809438131



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to