我对taskdef和classname不太熟悉...我在从另一个蚂蚁脚本运行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脚本的结构,因此这里的下一步是什么?
请告诉我,如果我这样做是对或错,我目前遇到问题
答案 0 :(得分:0)
您必须将.java
编译成.class
并使用classpath
的课程作为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>