0
点赞
收藏
分享

微信扫一扫

调试Spring源码时:Execution failed for task ‘:xxxx:checkStyleMain‘. > Checkstyle ruleviolations were found


问题描述

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

调试Spring源码时:Execution failed for task ‘:xxxx:checkStyleMain‘. > Checkstyle ruleviolations were found_xml

调试Spring源码时:Execution failed for task ‘:xxxx:checkStyleMain‘. > Checkstyle ruleviolations were found_测试类_02

解决办法

为了提高阅读源码的效率,需要配置checkStyle忽略这些提示。

需要在spring-framework/src/checkstyle/checkstyle.xml进行配置过滤器。

<module name="BeforeExecutionExclusionFileFilter">
		<property name="fileNamePattern" value="^.*\\spring\-user\\.*$"/>
	</module>

上述配置可让checkStyle排除spring-user目录夹下的文件。


举报

相关推荐

0 条评论