简体   繁体   English

如何在类路径中为ant脚本添加一个文件夹?

[英]How to add one folder in classpath for ant script?

I need to add a folder in current classpath for ant script that I have written for running java files. 我需要在当前类路径中为我编写的用于运行java文件的ant脚本添加一个文件夹。 How can it be done? 怎么做到呢?

You could add it as an attribute 您可以将其添加为属性

<java classpath="${extraDir}"
      classname="pkg.Class">
      ...
</java>

Or using the nested <classpath> tag: 或者使用嵌套的<classpath>标记:

<java classname="pkg.Class">
  <classpath>
    <pathelement path="${extraDir}"/>
  </classpath>
</java>

See the documentation for the Java task . 请参阅Java任务的文档。

i added the following line in the tag of the task and it ran successfully. 我在任务的标记中添加了以下行,并且它成功运行。

<pathelement path="C:\JunitTest\folderIsHere"/>

and after this the script ran successfully. 然后脚本成功运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM