如何在Hudson中为Ant配置checkstyle配置?

如何在Hudson中为Ant配置checkstyle配置?,ant,hudson,checkstyle,Ant,Hudson,Checkstyle,如何配置checkstyle(在Ant nt Maven中)任务?我试了一点,但没有得到正确的报告。这是我的ant脚本 <target name="checkStyle"> <taskdef resource="checkstyletask.properties"> <classpath refid="compile.class.pathtest"/> </taskdef> <checkstyle c

如何配置checkstyle(在Ant nt Maven中)任务?我试了一点,但没有得到正确的报告。这是我的ant脚本

<target name="checkStyle">
    <taskdef resource="checkstyletask.properties">
        <classpath refid="compile.class.pathtest"/>
    </taskdef>

    <checkstyle config="${source.code.dir}/config/sun_checks.xml">
        <fileset dir="${base.working.dir}/JavaFolder">
            <include name="**/*.java"/>
        </fileset>
        <formatter type="plain"/>
        <formatter type="xml" toFile="checkstyle-result.xml"/>
    </checkstyle>
</target>

<path id="compile.class.pathtest">
    <pathelement location="${checkstyle.dir}/checkstyle-5.5-all.jar"/>
    <pathelement location="${checkstyle.dir}/checkstyle-5.5.jar"/>
    <pathelement location="${checkstyle.dir}/pmd-3.9.jar"/>
    <pathelement location="${checkstyle.dir}/asm-3.0.jar"/>
    <pathelement location="${checkstyle.dir}/backport-util-concurrent-2.1.jar"/>
    <pathelement location="${checkstyle.dir}/jaxen-1.1-beta-10.jar"/>
    <pathelement location="${checkstyle.dir}/saxpath-1.0-FCS.jar"/>
</path>

sun_checks.xml文件是什么?我已下载并保存在上述文件夹中。运行生成时,它会显示一些警告和错误。后来就是这样

构建失败

C:\server\build.xml:9725:执行此行时发生以下错误: C:\server\build.xml:3838:56个错误和27599个警告

你能告诉我怎么解决这个问题吗


谢谢

sun_checks.xml文件包含评估源代码时应应用的所有规则

生成失败,因为checkstyle发现错误

您可以将属性设置为false以避免出现这种情况。此属性未设置时默认为true

<checkstyle config="${source.code.dir}/config/sun_checks.xml" failOnViolation="false">
    <fileset dir="${base.working.dir}/JavaFolder">
        <include name="**/*.java"/>
    </fileset>
    <formatter type="plain"/>
    <formatter type="xml" toFile="checkstyle-result.xml"/>
</checkstyle>

在哪里设置这些道具
source.code.dir
base.working.dir