0

我使用 MobileFirst 6.3 并在 Windows 7 中编写了以下 ant Build.xml 我安装了最新的 CLI。

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="adapter">
  <taskdef resource="com/worklight/ant/defaults.properties">
    <classpath>
      <pathelement location="C:\Tools\IBM\MobileFirst-CLI\mobilefirst-cli\node_modules\generator-worklight-server\lib\worklight-ant-deployer.jar"/>
    </classpath>
  </taskdef>
  <target name="adapter">
    <adapter-builder
        folder="C:\pruebas\adapters\adapter"
        destinationfolder="C:\pruebas\bin"/>
    </target>
</project>

当我使用以下命令“ant adapter”执行任务时,它给了我以下错误:

C:\pruebas\ANT>ant adapter
Buildfile: C:\pruebas\ANT\build.xml

adapter:

BUILD FAILED
C:\pruebas\ANT\build.xml:11: Problem: failed to create task or type adapter-buil
der
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.


Total time: 0 seconds

有什么帮助吗?

4

1 回答 1

1

您说您正在尝试使用 Ant构建适配器,但您指向的是适配器部署程序 .jar 文件...

请参阅以下用户文档主题:https ://www-01.ibm.com/support/knowledgecenter/SSHS8R_6.3.0/com.ibm.worklight.deploy.doc/devref/r_ant_tasks_buld_deploy_apps.html

您应该尝试指向:

  • C:\Tools\IBM\MobileFirst-CLI\public\worklight-ant-builder.jar,或
  • C:\Tools\IBM\MobileFirst-CLI\mobilefirst-cli\node_modules\generator-worklight-server\lib\worklight-ant-builder.jar
于 2015-03-10T19:11:47.950 回答