【问题标题】:Including additional source locations for chekstyle in ant task在 ant 任务中包括 chekstyle 的其他源位置
【发布时间】:2011-01-12 04:16:21
【问题描述】:

我正在从一个 ant 任务运行 checkstyle 检查。我都已正确配置,可以毫无问题地运行任务。

但是我有另一个项目/文件夹,其中包含从我的源文件(主要源)中引用的其他源文件(我们称它们为第三方源)。我希望 checkstyle 只检查主要来源,但它需要 类路径中的第三方来源 或以某种方式,否则我会收到 ClassNotFound 错误。

有什么建议吗?

我在ant中的配置如下:

<checkstyle config="sun_checks.xml" failOnViolation="false" >
    <fileset dir="${src.dir}" includes="**/*.java" />
    <formatter type="xml" toFile="${report.dir}/checkstyle_sun.xml" />
</checkstyle>

【问题讨论】:

    标签: java ant checkstyle


    【解决方案1】:

    你可以为 checkstyle 任务设置一个类路径参数:

    classpath 使用的类路径 查课。默认为 当前类路径。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-27
      相关资源
      最近更新 更多