我不太熟悉taskdef和类名。。。我在从另一个蚂蚁脚本运行蚂蚁脚本时遇到问题
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:Work6.70_ExtensionsNightlyBuildnightly_build.xml:31: The following error occurred while executing this line:
2011-05-25 15:50:26,040 [Thread-23] WARN ScriptRunner - C:Work6.70_ExtensionsNightlyBuildMaster 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.7 0_Extendings\Nightly Build.com\ANT_Tasks,我在那个文件夹里有一个CFileEdit.java。有人知道怎么了吗?
编辑:
我不想改变我的ANT脚本的结构,那么下一步该怎么做呢?
- 我将CFileEdit.java文件编译为CFileEdit.class
- 我将CFileEdit.class转换为CFileEdit.jar
- 我把这个CFileEdit.jar放在C:\apache-ant-1.82\lib中,这是我的ant目录吗
请告诉我我做得对还是错,我目前的有问题
必须将.java
编译为.class
,并将classpath
的类用于taskdef
- 编译CFileEdit.java
- 定义taskdef如下-
<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>