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

Thorsten Glaser commented on MDEP-714:
--------------------------------------

[~lars-sh] good point!

I guess we cannot “simply” add a new scope to Maven, nor annotate the 
{{dependency}} tags themselves. So adding a documented one-liner override like 
[here|https://github.com/tarent/rfc822/blob/db4b50e7ac16619ef75779b6489cddf9b410d2b6/pom.xml#L226-L227]
 seems like the best solution for this kind of {{testRuntime}} dependency.

In old projects, with many reported unused dependencies once this plugin is 
turned on, it can be challenging to figure out which is which, though… but 
that’s neither here nor there.

It *might* make sense for MDEP to add a hardcoded list of a couple of overrides 
(specifically, test-scoped {{testRuntime}} dependencies). But once this is 
added, everyone will add bugreports asking why the thing _they_ use isn’t on 
the list, so it might be wise to not do it, from a maintenance PoV.

> Add analyze parameter "ignoreUnusedRuntime"
> -------------------------------------------
>
>                 Key: MDEP-714
>                 URL: https://issues.apache.org/jira/browse/MDEP-714
>             Project: Maven Dependency Plugin
>          Issue Type: New Feature
>          Components: analyze
>            Reporter: Elliotte Rusty Harold
>            Assignee: Michael Osipov
>            Priority: Major
>             Fix For: 3.2.0
>
>
> Typical output when analyzing the maven-archetype-plugin:
> [WARNING] Unused declared dependencies found:
> [WARNING]    org.apache.ivy:ivy:jar:2.5.0:runtime
> However since this is needed at runtime, possibly via reflection, it seems 
> likely that it is used but the dependency analyzer can't figure this out.
> Confirm and consider whether the plugin should simply never report runtime 
> dependencies as unused. 
> This is tricky because it's certainly possible that a runtime dependency is 
> unused, but in practice it seems more likely than not to be a false positive.



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

Reply via email to