【问题标题】:Configure ANT to run Lint4J配置 ANT 以运行 Lint4J
【发布时间】:2015-04-21 06:59:16
【问题描述】:

我有一个 github 存储库,运行 Java 和 JUnit,我也想运行 lint4j。我的项目是建立在 travis-ci 之上的。

但是,lint 失败了:

BUILD FAILED
/home/travis/build/jvoller/SPDDB/build.xml:39: Problem: failed to create task or type lint4j
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place. 

我的 ANT 脚本有什么问题?

  <target name="lint" description="runs lint4j on source files" >
    <mkdir dir = "tmp" />
      <lint4j sourcepath="src"
        classpath="lib/junit-4.11.jar"
        packages="${main.src.dir}.*"
        level="5"
        exact="false" >
      <formatters>
        <formatter type="text" />
        <formatter type="text" toFile="tmp/lint.out"/>
      </formatters> 
    </lint4j>
  </target>

【问题讨论】:

    标签: java ant continuous-integration travis-ci jslint4java


    【解决方案1】:

    必须定义lint4j 任务。

    <taskdef name="lint4j" classname="com.jutils.lint4j.ant.Lint4jAntTask">
      <classpath><pathelement location="lib/lint4j.jar"/></classpath>
    </taskdef>
    

    并且lint4j.jar 必须可用。

    【讨论】:

      猜你喜欢
      • 2011-08-26
      • 1970-01-01
      • 2016-06-23
      • 1970-01-01
      • 2013-07-05
      • 2015-01-01
      • 2013-06-25
      • 1970-01-01
      • 2015-01-07
      相关资源
      最近更新 更多