[ 
https://jira.codehaus.org/browse/MCHECKSTYLE-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=353273#comment-353273
 ] 

Robert Scholte edited comment on MCHECKSTYLE-70 at 9/26/14 10:57 AM:
---------------------------------------------------------------------

[~michael-o], for several reasons: 
1. backwards compatibility. With previous version you could change the 
{{sourceDirectory}}, this should still be possible with the current plugin.
2. checkstyle is a bit different compared to other plugins. You don't always 
have control over the style of the java-files, especially if these files are 
generated. I could assume that every generated source-directory is placed under 
{{target/}}, but that would make the plugin much more complicator.
3. the checkstyle-plugin shouldn't be aware of other plugins, like it would 
allow sourceDirectories added by the buildhelper-maven-plugin, but refuse the 
sourceDirectories of jaxb-maven-plugin.
So I exposed {{sourceDirectories}} with default 
{{project.getCompileSourceRoots()}} (as your wish), which is already better 
compared to the previous versions of the checkstyle-plugin.
As said in my latest comment: the checkstyle is actually using the wrong roots, 
since it is not only about java-files. It should be:
main: includes {{\*\*/\*}}, excludes {{src/test/\*\*/\*, target/\*\*/\*}}
test: include {{src/test/\*\*/\*}}
But that's a whole new approach, so a huge impact. (and even then you should 
offer users to change it)



was (Author: rfscholte):
[~michael-o], for several reasons: 
1. backwards compatibility. With previous version you could change the 
{{sourceDirectory}}, this should still be possible with the current plugin.
2. checkstyle is a bit different compared to other plugins. You don't always 
have control over the style of the java-files, especially if these files are 
generated. I could assume that every generated source-directory is placed under 
{{target/}}, but that would make the plugin much more complicator.
3. the checkstyle-plugin shouldn't be aware of other plugins, like it would 
allow sourceDirectories added by the buildhelper-maven-plugin, but refuse the 
sourceDirectories of jaxb-maven-plugin.
So I exposed {{sourceDirectories}} with default 
{{project.getCompileSourceRoots()}} (as your wish), which is already better 
compared to the previous versions of the checkstyle-plugin.
As said in my latest comment: the checkstyle is actually using the wrong roots, 
since it is not only about java-files. It should be:
main: includes {{**/*}}, excludes {{src/test/**/*, target/**/*}}
test: include {{src/test/**/*}}
But that's a whole new approach, so a huge impact. (and even then you should 
offer users to change it)


> Support for multiple source folders
> -----------------------------------
>
>                 Key: MCHECKSTYLE-70
>                 URL: https://jira.codehaus.org/browse/MCHECKSTYLE-70
>             Project: Maven Checkstyle Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.1
>            Reporter: Jan Palmquist
>            Assignee: Robert Scholte
>            Priority: Minor
>             Fix For: 2.13
>
>
> It would be great if this plugin would support multiple source folders added 
> by http://mojo.codehaus.org/build-helper-maven-plugin/ (or similar), and by 
> default inspect sources from these folders instead of just 
> $\{project.build.sourceDirectory}. Correspondingly with respect to test 
> sources if those are configured to be included.
> There are other plugins available solving this problem (somehow), eg:
> * http://mojo.codehaus.org/jdepend-maven-plugin/
> * http://mojo.codehaus.org/findbugs-maven-plugin/
> Maybe they can give some inspiration for how to make this possible?



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to