1、设置user.properties
- #项目名称
- project.name=WebService_Restful
- #项目所在的路径
- project.dir=D://workspaces//webservice//Restful
- #源文件所在的路径
- project.src.dir=${project.dir}//src//main//java
2、build.xml
-
<projectname="checkstyle"default="checkstyle"basedir=".">
-
-
<propertyfile="user.properties"/>
- <!-------------------
- target:init
-
------------------->
-
<targetname="init">
-
<tstamp/>
-
-
<propertyname="project.checkstyle.report.dir"value="${project.dir}/report"/>
-
-
<propertyname="project.check.result.name"value="${project.name}-checkstyle-result-${DSTAMP}.xml"/>
-
-
<propertyname="project.check.report.name"value="${project.name}-checkstyle-report-${DSTAMP}.html"/>
-
-
<propertyname="checkstyle.config"value="${basedir}/sunrising_checks.xml"/>
-
-
<propertyname="checkstyle.report.style"value="${basedir}/contrib/checkstyle-noframes.xsl"/>
-
-
<propertyname="checkstyle.result"value="${project.checkstyle.report.dir}/${project.check.result.name}"/>
-
-
<propertyname="checkstyle.report"value="${project.checkstyle.report.dir}/${project.check.report.name}"/>
-
-
<mkdirdir="${project.checkstyle.report.dir}"/>
-
</target>
-
<taskdefresource="checkstyletask.properties"classpath="${basedir}/lib/checkstyle-all-5.0-beta01.jar"/>
- <!-------------------
- target:checkstyle
-
------------------->
-
<targetname="checkstyle"depends="init"description="Checkjavacodeandreport">
-
<echo>"${checkstyle.config}"</echo>
-
<checkstyleconfig="${checkstyle.config}"failOnViolation="false"failureProperty="checkstyle.failure">
-
<formattertype="xml"tofile="${checkstyle.result}"/>
-
<filesetdir="${project.src.dir}"includes="**/*.java"/>
-
</checkstyle>
-
<xsltin="${checkstyle.result}"out="${checkstyle.report}"style="${checkstyle.report.style}"/>
-
</target>
- <!-------------------
- target:mailTarget
-
------------------->
-
<targetname="mailCheckStyleReport">
-
<mailmailhost="mail.mydomain.cn"mailport="25"subject="Checkstyleviolation(s)inproject${ant.project.name}"user="myname@mydomain.cn"password="mypass"files="myattchment">
-
<fromaddress="ci@mydomain.cn"/>
-
<replytoaddress="cimanager@mydomain.cn"/>
-
<toaddress="myname@mydomain.cn"/>
-
<message>TESTMAILFROM CheckStyle</message>
-
</mail>
-
</target>
-
</project>
3、注意
A)CheckStyle的jar位于当前basedir目录的lib中;
B)javax.activation.jar和mail.jar放到apache-ant-1.7.0/lib目录下,否则mailTarget不可用。
分享到:
相关推荐
checkstyle-android 一个配置,该配置与最匹配。 许多Android项目选择遵循这些准则,并且这种checkstyle配置有助于在代码上强制实施它们。 这仍在进行中! 到目前为止,仅执行了一些规则。 查看下面的#...
示例存储库,以演示6.x版和8.9版之间checkstyle导入顺序检查... [INFO] --- maven-checkstyle-plugin:3.0.0:checkstyle (default-cli) @ checkstyle-poc --- [WARNING] File encoding has not been set, using platfor
npm install --save-dev jshint-checkstyle-file-reporter 用法 标准JSHint cli # optional specify a different filename export JSHINT_CHECKSTYLE_FILE= " jshint.xml " # default: checkstyle.xml # run jshint...
前端开源库-gulp-stylelint-checkstyle-reportergulp-stylelint-checkstyle reporter、gulp-stylelint-reporter,用于将stylelint结果以checkstyle插件格式写入XML文件
swagger-api-checkstyle 定义用于API治理的Swagger定义的约定在微服务环境中,验证设计与平台标准的一致性的能力至关重要。 管理标准中需要关注的一些领域: 路径,参数和operationId的命名约定限制动词,状态的使用...
diff-checkstyle 请注意,此存储库不再维护,有关更好的选择,请查看 。 介绍 当使用扫描项目时,它将立即在每个文件中输出所有问题。 这使得在清除所有现有样式问题之前,很难对正在开发的代码进行有效的样式检查...
sevntu-checks: sevntu-checkstyle-idea-extension: sevntu-checkstyle-sonar-plugin: eclipsecs-sevntu-plugin: Maven回购上的所有sevntu工件: ://repo1.maven.org/maven2/com/github/sevntu-checkstyle/ ...
可以在已经存在的checkstyle-report xml文件上使用cs2pr 。 另外,您也可以在unix-pipe表示法中使用它,将其链接到现有的cli命令中。 在GitHub Action工作流程中运行以下命令之一: 处理Checkstyle格式的文件 cs2pr...
kemitix-checkstyle-规则集 提供与Checkstyle一起使用的广泛Checkstyle规则集,以及完整配置的maven-tile。 规则集包括来自核心Checkstyle库和Sevntu-Checkstyle库的检查。 用法 使用规则集的最简单方法是使用maven...
CCAoA Java Checkstyle 基于Java代码的Checkstyle标准Checkstyle版本可在找到Checkstyle的最新发行版本。 Google Java样式指南通常会稍微落后于当前版本,因此在升级之前进行测试非常重要。 此外,为确保我们与工具...
Checkstyle 的 XML 扩展此扩展为 checkstyle 提供了检查 XML 文件的能力。 构建 jar,将其添加到类路径并通过 XML 运行 checkstyle!映射类型从 Java 转换为重用可用的检查。 这是当前的映射: DOCUMENT 对应于 Java...
flycheck-checkstyle 使用checkstyle的flycheck检查器
权力检查适用于Java和Scala工件的Opower Engineering ... < plugin> < groupId>org.apache.maven.plugins</ groupId> < artifactId>maven-checkstyle-plugin</ artifactId> < dependencies> < dependency> < groupId>...
CheckStyle-IDEA :copyright:版权所有2006-2020 CheckStyle-IDEA贡献者 托管在 JetBrains的IntelliJ IDEA 2019-20插件,可通过检查针对给定的配置文件提供实时反馈。 请注意,这不是Checkstyle的正式组成部分-...
贡献给 您已发现错误或对超酷的新功能有任何想法? 贡献代码是将某些东西还给开源社区的好方法。 在深入研究代码之前,我们需要一些准则供贡献者遵循,以便我们有机会掌握最新知识。入门确保您拥有。...
checkstyleConfig " org.hildan.checkstyle:checkstyle-config:1.1.0 " } checkstyle { // affects all Checkstyle tasks config = resources . text . fromArchiveEntry(configurations . checkstyleConfig, " ...
checkstyle-xml-config Checkstyle 是一种开发工具,可帮助程序员编写符合编码标准的 Java 代码。 它使检查 Java 代码的过程自动化,使人类免于这项无聊(但重要)的任务。 这使其成为想要强制执行编码标准的项目的...
【超值下载----代码质量的保证 CheckStyle的“中文文档” CheckStyle的“官方资料” CheckStyle的“checkclipse插件” 【下载不扣分,回帖加1分,欢迎下载,童叟无欺】
action-checkstyle:基于reviewdog的GitHub操作,可在Java代码上运行Checkstyle
代码检测工具(侧重于代码的风格检测,如缩进、空行、花括号的匹配等等) 下载地址:https://github.com/checkstyle/checkstyle/releases/