build.xml中包含的jar文件未在声明的顺序中的类路径中获取

时间:2018-06-05 07:21:43

标签: ant build.xml

这是我的build.xml文件。我已经按照我要求的特定顺序包含了jar文件(这很重要。如果不是,我会得到包密封异常)。但我获得的类路径是:

p.waitFor();
  

我做错了什么?我怎样才能确保我的tesseract包装器始终是第一个包含的罐子?我是ANT的初学者。

[echo] Classpath is C:\Users\aswathy_krishnan\eclipse-workspace\MerckDemo\lib\iwats-scripting-library-v1.9.jar;C:\Users\aswathy_krishnan\eclipse-workspace\MerckDemo\lib\jcommander-1.27.jar;C:\Users\aswathy_krishnan\eclipse-workspace\MerckDemo\lib\json-20160810.jar;C:\Users\aswathy_krishnan\eclipse-workspace\MerckDemo\lib\tessract-wrapper.jar;C:\Users\aswathy_krishnan\eclipse-workspace\MerckDemo\lib\testng-6.11.jar

我尝试通过testNG运行测试,它工作正常。这是因为我优先考虑我的tesseract jar以及buildpath的导出选项卡。请帮忙。

1 个答案:

答案 0 :(得分:0)

fileset不会导致有序集合。要在类路径定义中对元素进行排序,您应该使用多个<pathelement ...>代替:

<path id="build.classpath">
    <pathelement location="${lib}/tessract-wrapper.jar"/>
    <pathelement location="${lib}/testng-6.11.jar"/>
    <pathelement location="${lib}/iwats-scripting-library-v1.9.jar"/>
    <pathelement location="${lib}/json-20160810.jar"/>
    <pathelement location="${lib}/jcommander-1.27.jar"/>
</path>