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

Michael Osipov commented on MCHECKSTYLE-444:
--------------------------------------------

Why is this a bug? Sources and resources are two distinct entities. I'd expect 
that there would be a separate flag, no?

> Support exclusion of generated (test) resources
> -----------------------------------------------
>
>                 Key: MCHECKSTYLE-444
>                 URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-444
>             Project: Maven Checkstyle Plugin
>          Issue Type: Bug
>          Components: checkstyle:check
>    Affects Versions: 3.3.1
>            Reporter: Stephan Schroevers
>            Priority: Major
>
> In the context of MCHECKSTYLE-412 a new {{excludeGeneratedSources}} option 
> was introduced. This feature does not exclude generated {_}resources{_}, 
> however. Generated resources are not uncommon:
>  # The 
> [license-maven-plugin|https://github.com/mojohaus/license-maven-plugin] 
> attaches a {{THIRD-PARTY.txt}} file.
>  # The [hisrc-basicjaxb plugin|https://github.com/patrodyne/hisrc-basicjaxb] 
> attaches a {{META-INF/sun-jaxb.episode}} file, located in a directory that 
> also contains generated sources ((!)).
> As a result, if one sets
> {code:xml}
> <excludeGeneratedSources>true</excludeGeneratedSources>
> <resourceIncludes>**/*</resourceIncludes>
> {code}
> Then the plugin will flag {{THIRD-PARTY.txt}} files (not completely 
> unexpected) as well as XJC-generated Java files (very unexpected).
> Possible fixes:
>  # Update the {{excludeGeneratedSources}} flag to also cover (test) resource 
> directories.
>  # Introduce an analogous {{excludeGeneratedResources}} flag.
> (The first option may seem less flexible, but would be less surprising i.c.w. 
> plugins that generate sources and resources into the same directory, as in 
> example (2) above.)
> I'm open to contributing a PR for this change; it would be nice to first hear 
> from the maintainers whether they prefer approach (1) or (2).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to