ant 脚本taskdef 和类名未找到

发布于 2024-11-10 04:30:31 字数 1040 浏览 2 评论 0原文

我对taskdef和classname不太熟悉...我在从另一个ant脚本运行ant脚本时遇到问题:

2011-05-25 15:50:26,040 [Thread-23] WARN  ScriptRunner     - BUILD FAILED
2011-05-25 15:50:26,040 [Thread-23] WARN  ScriptRunner     - C:\Work\6.70_Extensions\NightlyBuild\nightly_build.xml:31: The following error occurred while executing this line:
2011-05-25 15:50:26,040 [Thread-23] WARN  ScriptRunner     - C:\Work\6.70_Extensions\NightlyBuild\Master Build.xml:6: taskdef class com.ANT_Tasks.CFileEdit cannot be found

其中第6行是:

<taskdef mame="CFileEdit" classname="com.ANT_Tasks.CFileEdit" />

我的根目录是C:\Work\6.70_Extensions\NightlyBuild,我有一个文件夹C: \Work\6.70_Extensions\NightlyBuild\com\ANT_Tasks ,我在该文件夹中有一个 CFileEdit.java 。有人知道出了什么问题吗?

编辑:

我不想更改 ANT 脚本的结构,因此下一步是什么?

  1. 我将我的 CFileEdit.java 文件编译为 CFileEdit.class
  2. 我将 CFileEdit.class 转换为 CFileEdit.jar
  3. 我将此 CFileEdit.jar 放入 C:\apache-ant-1.8.2\lib 这是我的 ant 目录?

请告诉我我这样做是对还是错,我目前遇到了问题

i am not very familar with taskdef and classname... i am having trouble running an ant script from another ant script:

2011-05-25 15:50:26,040 [Thread-23] WARN  ScriptRunner     - BUILD FAILED
2011-05-25 15:50:26,040 [Thread-23] WARN  ScriptRunner     - C:\Work\6.70_Extensions\NightlyBuild\nightly_build.xml:31: The following error occurred while executing this line:
2011-05-25 15:50:26,040 [Thread-23] WARN  ScriptRunner     - C:\Work\6.70_Extensions\NightlyBuild\Master Build.xml:6: taskdef class com.ANT_Tasks.CFileEdit cannot be found

where line 6 is:

<taskdef mame="CFileEdit" classname="com.ANT_Tasks.CFileEdit" />

my root directory is C:\Work\6.70_Extensions\NightlyBuild and i have a folder C:\Work\6.70_Extensions\NightlyBuild\com\ANT_Tasks and i have a CFileEdit.java in that folder. Anybody knows what is wrong?

Edit:

I do not wish to change the structure of my ANT script, therefore what is the next step here?

  1. i Complied my CFileEdit.java file into CFileEdit.class
  2. I converted CFileEdit.class into CFileEdit.jar
  3. i put this CFileEdit.jar into C:\apache-ant-1.8.2\lib where this is my ant directory?

please tell me if i am doing it right or wrong, i am having issues with this currently

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谈场末日恋爱 2024-11-17 04:30:31

您必须将 .java 编译为 .class 并使用该类作为 classpath 来进行 taskdef

  1. 编译 CFileEdit。 java
  2. 定义taskdef如下 -
 
    <类路径>
        
      

You must compile the .java into a .class and use the class for classpath for the taskdef

  1. Compile CFileEdit.java
  2. Define taskdef as follows -
<taskdef name="CFileEdit" classname="com.ANT_Tasks.CFileEdit"> 
    <classpath>
        <!-- refer to the compiled class here along with others as necessary to execute the task -->
      </classpath>
</taskdef>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文