0
我已经创建了一个自定义Ant任务,按照我之前的posts之一调用另一个xml文件中的现有目标。从自定义任务中调用Ant目标会导致“无法创建任务或导入类型”错误
它似乎是在做什么,我想呼吁,我想构建XML方面,但是,它现在抛出一个非常奇怪的错误:
build.xml:4: Problem: failed to create task or type import
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:369)
at org.hardhat.task.HardHatTask.executeHardHat(HardHatTask.java:47)
at org.hardhat.task.HardHatTask.execute(HardHatTask.java:23)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
构建XML是我的自定义Ant任务调用看起来是这样的:
<project name="myproject" default="all" basedir=".">
<import file="includes.xml"/>
<target name="all" depends="doStuff" />
</project>
错误表示,问题与4号线和任务“进口”的事情。关于为什么Ant似乎不了解自己的任务之一的任何想法?