【问题标题】:Error while running the build.xml usint ANT Build in eclipse/junit在 eclipse/junit 中运行 build.xml usint ANT Build 时出错
【发布时间】:2015-06-24 02:06:20
【问题描述】:

我是 webdriver 的新手,我只想执行我的脚本并使用 selenium/Junit 中的 ANT Build 生成测试结果。当我尝试运行脚本时,出现以下错误:

${ECLIPSE_HOME}\plugins 不存在。

我该如何解决这个问题?

Buildfile: C:\Users\xxx\workspace\Script\build.xml
build-subprojects:
init:
build-project:
     [echo] Script: C:\Users\xxx\workspace\Script\build.xml
build:
clean:
   [delete] Deleting directory C:\Users\xxx\workspace\Script\bin
cleanall:
clean:
init:
    [mkdir] Created dir: C:\Users\xxx\workspace\Script\bin
build-subprojects:
init:
build-project:
     [echo] Script: C:\Users\xxxx\workspace\Script\build.xml
    [javac] Compiling 4 source files to C:\Users\xxx\workspace\Script\bin
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
    [javac] 1 warning
build-refprojects:
init-eclipse-compiler:

BUILD FAILED
C:\Users\xxxx\workspace\Script\build.xml:43: C:\Users\xxxx\workspace\Script\${ECLIPSE_HOME}\plugins does not exist.

Total time: 1 second

【问题讨论】:

    标签: java eclipse selenium ant junit


    【解决方案1】:

    {ECLIPSE_HOME} 是 ant 正在寻找但尚未定义的属性。您可以在 build.xml 的顶部定义此属性:

    <property
        name="ECLIPSE_HOME"
        location="C:\Program Files\eclipse" />
    

    或者您可以将属性添加到环境变量下的 PATH 中

    或者,如果您的 build.xml 引用了 project.properties 或 ant.properties 文件,您可以添加以下行:

    ECLIPSE_HOME=C:\Program Files\eclipse
    

    请注意“C:\Program Files\eclipse”只是一个示例,请将您的 Eclipse 的真实目录路径放在您的机器上。

    【讨论】:

    • 感谢@ripple 的回复......更改代码后......并得到一个新的错误,如 tis............C:\Users\xxxxxxx\workspace\ Script\build.xml:41:找不到类:org.eclipse.jdt.core.JDTCompilerAdapter
    • 感谢重播和 itz 现在工作正常,但我收到一个新错误,例如............workspace\Script\build.xml:41: Class not found: org .eclipse.jdt.core.JDTCompilerAdapter
    猜你喜欢
    • 2013-10-24
    • 2015-01-16
    • 1970-01-01
    • 2016-01-19
    • 2015-02-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-29
    • 2015-02-23
    相关资源
    最近更新 更多