Piotr Karwasz created RAT-552:
---------------------------------

             Summary: `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
            Reporter: Piotr Karwasz


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)

Reply via email to