问题描述
看Spring源码的过程中,不可避免要写一些测试类,但是由于Spring源码项目中配置了checkstyle,导致自己写的代码在build时被检测出类似header.mismatch 的格式问题。不过这些问题在我们阅读源码时,可以尽可能的忽略。抓大放小。


解决办法
为了提高阅读源码的效率,需要配置checkStyle忽略这些提示。
需要在spring-framework/src/checkstyle/checkstyle.xml进行配置过滤器。
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="^.*\\spring\-user\\.*$"/>
</module>上述配置可让checkStyle排除spring-user目录夹下的文件。










