【问题标题】:No output from Checkstyle in ANTANT 中的 Checkstyle 没有输出
【发布时间】:2012-03-27 03:18:25
【问题描述】:

我没有使用自动构建工具。只需 Checkstyle 5.5 和 ANT 1.8。 我正在尝试在我的 ANT 脚本中运行 Checkstyle。 ANT 脚本执行没有错误,但似乎没有调用 Checkstyle。除了 ANT 报告 BUILD SUCCESSFUL,我没有得到任何输出。 这是我的蚂蚁脚本:

<project name="ccu" xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">

<target name="checkstyle" description="Generates a report of code convention violations.">

<cs:checkstyle config="custom_check.xml">
<fileset dir="src" casesensitive="yes">
  <include name="**/*.java"/>
</fileset>
<!--
  <fileset dir="src" includes="**\*.java"/>
-->
</cs:checkstyle>

</target>
</project>

我错过了什么?

【问题讨论】:

    标签: ant checkstyle


    【解决方案1】:

    这是一个类路径问题。出于某种原因,我需要将 ANT 类路径指向类文件而不是 jar。 我的最终脚本如下所示:

    <project name="ccu" xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
    
    <taskdef resource="checkstyletask.properties">
            <classpath>  
                    <pathelement location="C:\myClasses\bin"/>
                    <pathelement location="C:\checkstyle-5.5\checkstyle-5.5-all.jar"/>
            </classpath>
    </taskdef>
    
    <checkstyle config="custom_check.xml">
    
      <fileset dir="src" includes="**/*.java"/>
    
    </checkstyle>
    
    </project>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-07-05
      • 2021-09-16
      • 1970-01-01
      • 1970-01-01
      • 2016-10-15
      • 2015-02-05
      • 1970-01-01
      相关资源
      最近更新 更多