[
https://issues.apache.org/jira/browse/MDEP-804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17530538#comment-17530538
]
Henning Schmiedehausen commented on MDEP-804:
---------------------------------------------
You are correct, this would be equivalent. However, the normal use case for a
flag is something like this:
{quote}<configuration>
<
ignoreAllNonTestScoped>${some.property.used.by.the.build.system></ignoreAllNonTestScoped>
</configuration>
{quote}
We have massive build configurations with dozens of modules and multiple
projects. I can add the block that you suggested to our master pom and as a
result, I can not use the option anywhere, because now I would need to undo
that global setting and add my explicit excludes. This is a very brittle and
complicated way to do this. With a flag, I can set the flag in the projects
where I want to ignore all deps and unset it in all the others (and there I can
add the explicit excludes).
As the original author of quite a bit of these excludes (yeah, look it up; I
was as surprised as you. Back in 2015. :-) ), I have done a lot of workarounds
before adding flags. For large scale systems, flags are a life-saver because
they allow property driven enabling/disabling of features in a way that the
lists do not.
(Technically I should still be a committer on Apache Maven; I don't think my
commit bit ever lapsed. I very much prefer to have a discussion about this, but
I don't feel that a blanket "There is a workaround that does it in isolation"
statement is the best answer).
> Allow auto-ignore of all non-test scoped dependencies used only in test scope
> -----------------------------------------------------------------------------
>
> Key: MDEP-804
> URL: https://issues.apache.org/jira/browse/MDEP-804
> Project: Maven Dependency Plugin
> Issue Type: New Feature
> Components: analyze
> Affects Versions: 3.3.0
> Reporter: Henning Schmiedehausen
> Priority: Major
> Labels: pull-request-available
> Fix For: wontfix-candidate
>
>
> Pre-3.2.0, dependencies that were used only in test scope but not declared in
> test scope (most likely declared in compile scope) were accepted by the
> plugin and not flagged as a problem.
> Starting with 3.2.0 (and the current 3.3.0), these are reported with
> "Non-test scoped test only dependencies found". If the scope of the
> dependencies can not be changed (there are many reasons for that in large
> projects), the old behavior can be restored by adding each flagged dependency
> to the "ignoredNonTestScopedDependencies" configuration option in the
> respective project.
> This is, especially in large projects, cumbersome and brittle.
> There should be a boolean flag, "ignoreAllNonTestScoped" that, when set,
> allows ignoring non-test scoped dependencies if they are used only in test
> scope. This flag restores the pre-3.2.0 behavior.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)