[
https://issues.apache.org/jira/browse/RAT-552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18079908#comment-18079908
]
Piotr Karwasz commented on RAT-552:
-----------------------------------
This case is different from RAT-97: the projects that RAT fails to exclude are
not nested subprojects but top level ones.
I double checked and migrating from {{excludes}} to {{inputExcludes}} *does*
fix the issue: when {{excludes}} are used, the internally generated
{{inputExcludes}} for subprojects are ignored. This does not happen any more,
once both the external and internal parameters use {{inputExcludes}}.
> `excludeSubProjects` ineffective when deprecated `excludes` configuration is
> present
> ------------------------------------------------------------------------------------
>
> Key: RAT-552
> URL: https://issues.apache.org/jira/browse/RAT-552
> Project: Apache RAT
> Issue Type: Bug
> Components: Client - maven
> Affects Versions: 0.17
> Reporter: Piotr Karwasz
> Priority: Minor
> Fix For: 1.0.0
>
>
> As a consequence of the option renaming in RAT-390, since version 0.17 the
> {{excludeSubProjects}} option of the Maven plugin is silently disabled
> whenever the deprecated {{excludes}} configuration is also used.
> The root cause is in how sub-module exclusions are registered. The plugin
> appends the {{<module>/**}} patterns to {{inputExcludes}}, but the shared
> argument-map helper rejects writes to a non-deprecated option when its
> deprecated alias (here {{excludes}}) has already been populated. As a result,
> the sub-module patterns are silently dropped and the plugin descends into
> every sub-module directory.
> The workaround is to replace the deprecated {{excludes}} configuration with
> {{inputExcludes}}. Given the ephemeral nature of the coexistence between
> {{excludes}} and {{inputExcludes}}, I doubt fixing this issue is worth the
> effort, but I am filing it so that users hitting the same problem can find
> the workaround.
> Steps to reproduce:
> # Create a multi-module Maven project with a single {{module}} sub-module.
> # Add an inherited Maven RAT plugin configuration to the aggregator POM,
> containing a single {{hello.txt}} entry under {{excludes}}.
> # Add a {{hello.txt}} file without a license header to {{module}}.
> # Run a RAT check: it will fail on the aggregator module because of
> {{module/hello.txt}}.
> Expected behavior: the RAT check on the aggregator module should not descend
> into files belonging to its sub-modules.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)