在Windows中使用ant构建IBM MobileFirst适配器

时间:2015-03-10 19:01:53

标签: ant worklight-adapters ibm-mobilefirst mobilefirst-adapters

我正在使用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>

当我使用以下命令&#34; ant adapter&#34;执行任务时它给了我以下错误:

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

任何帮助?

1 个答案:

答案 0 :(得分:1)

您说您正在尝试使用Ant 构建适配器,但您指向适配器 deployer .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:\工具\ IBM \ MobileFirst-CLI \ mobilefirst-CLI \ node_modules \发电机 - 工作灯服务器\ lib中\工作灯-ANT-builder.jar