我正在使用此documentation。
它告诉我做这样的蚂蚁目标。
<target name="Deploy App">
<app-deployer deployable="${build.apps.dir}/app.wlapp"
worklightServerHost="http://${customConfig.worklightServer.host}:${customConfig.worklightServer.port}/${customConfig.runtime}"
userName="admin" password="admin" />
</target>
然而,当我运行此目标时,它告诉我app-deployer任务已被弃用,我应该使用其他东西。 整个信息如下:
[app-deployer] The Ant task <app-deployer> is no longer supported.
[app-deployer] You need to replace this invocation with an invocation of the <wladm> Ant task, like this:
[app-deployer] <taskdef resource="com/worklight/ant/deployers/antlib.xml">
[app-deployer] <classpath>
[app-deployer] <pathelement location="buildTools\buildJars\worklight-ant-deployer.jar"/>
[app-deployer] </classpath>
[app-deployer] </taskdef>
[app-deployer] <wladm url="** URL of Worklight administration services **" user="admin" password="admin">
[app-deployer] <deploy-app runtime="** project runtime name **" file="app.wlapp"/>
[app-deployer] </wladm>
[app-deployer] where values between ** markers are to be filled in.
我正在使用的worklight ant deployer的版本就是这个。
[echo] Worklight Ant task version 6.2.0.00.20140613-0730
然而,当我用wladm创建一个目标时,它会告诉我
Problem: failed to create task or type wladm
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
答案 0 :(得分:2)
所述错误消息“无法创建任务或类型wladm”的最常见原因是:
<taskdef>
。您可以将它放在不同的目标中,而不是在当前目标之前执行。修复方法是将其列在公共初始化目标中,或在<project>
下的任何目标目录之外。<taskdef>
是指不存在的文件或较早版本的worklight-ant-deployer.jar
而不是6.2.0。<taskdef>
加载resource="com/worklight/ant/defaults.properties"
,但在6.2中需要加载resource="com/worklight/ant/deployers/antlib.xml"
。答案 1 :(得分:0)
不完全是您问题的答案,但如果您不需要Ant,则可以在命令行中使用wladm。请参阅https://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.appadmin.doc/admin/r_wladm_program_app_commands.html
上的文档wladm命令位于[WorklightInstallDir] /快捷方式
中