Ant 蚂蚁无法识别外部命令 生成失败 C:\Users\SomeUser\Downloads\mule\u test\build.xml:69:问题:无法创建任务或类型cloudHubDeploy 原因:名称未定义。 措施:检查拼写。 操作:检查是否已声明任何自定义任务/类型。 措施:检查是否发生了任何/声明。

Ant 蚂蚁无法识别外部命令 生成失败 C:\Users\SomeUser\Downloads\mule\u test\build.xml:69:问题:无法创建任务或类型cloudHubDeploy 原因:名称未定义。 措施:检查拼写。 操作:检查是否已声明任何自定义任务/类型。 措施:检查是否发生了任何/声明。,ant,mule,Ant,Mule,命令: BUILD FAILED C:\Users\SomeUser\Downloads\mule_test\build.xml:69: Problem: failed to create task or type cloudHubDeploy Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action:

命令:

BUILD FAILED
C:\Users\SomeUser\Downloads\mule_test\build.xml:69: Problem: failed to create task or type cloudHubDeploy
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.

使用ant-contrib-1.0b3.jar但ant仍然无法识别该命令。

是第三方任务。您需要包括定义它的源代码或引用它的JAR


一个快速的谷歌搜索产生了这个。

正如@wiskyspider所说,这是一个第三方ANT任务,它总是意味着你在ANT类路径中丢失了一个jar

说明了启用任务所需的内容:

Ant是一种用于构建Java应用程序的工具,可以通过添加自定义任务对其进行扩展。这些任务将允许您构建和部署Mule应用程序

要使用这些任务,请执行以下操作:

<target name="deploy" depends="package">
    <cloudHubDeploy username="usr" password="pswd" domain="${app.name}" applicationFile="${app.file}" />
</target>
Add-lib mule-anttasks.jar到Ant命令行,将实现任务的类放入Ant的类路径中。
添加到Ant构建文件中,以导入任务定义。
mule-anttasks.jar还可以添加到以下目录之一,以便ANT在运行时提取它:

  • $antu HOME/lib
  • $HOME/.ant/lib

希望这有帮助。

我已经添加了源代码,它编译成功了,但仍然给我这个error@YashwanthSainath您是否已将
添加到Ant脚本中?
Add -lib mule-anttasks.jar to your Ant command line, to put the classes that implement the tasks in Ant's classpath.
Add <taskdef resource="org/mule/mulePackagingTasks.properties"/> to your Ant build file, to import the task definitions.