Specifies the location of the XML configuration to use. Potential values are a filesystem path, a URL, or a classpath resource. This parameter expects that the contents of the location conform to the xml format configuration of rulesets.
This parameter is resolved as resource, URL, then file. If successfully resolved, the contents of the configuration is copied into the ${project.build.directory}/checkstyle-configuration.xml file before being passed to Checkstyle as a configuration.
There are 2 predefined rulesets.sun_checks.xml & google_checks.xml
只校验变更的文件
刚开始考虑是通过java方式来操作svn来获取托管在svn上的项目的相关信息,调查发现了SVNKIT这东西,但是简要看了下发现,使用svnkit都需要配置url,username,pwd这些。但是我只是想获取各变更列表而已,而且代码校验也只是本地校验而已,就觉得太麻烦了。于是决定通过java执行本地cmd来获取稳健变更列表。具体实现如下:
参考步骤Using Custom Developed Checkstyle Checks,实现自定义的BeforeExecutionFileFilter
此步骤实现Checkstyle执行时只校验新增加和修改的文件。
/** * 只校验新增加的文件和新修改的文件 * Created by Vioao on 2017/11/23. */ public class CustomBeforeExecutionFileFilter extends AutomaticBean implements BeforeExecutionFileFilter { private static final Logger LOGGER = LoggerFactory.getLogger(PaicBeforeExecutionFileFilter.class);