我正试图在MobileFirst平台6.3中使用Ant构建project.war文件。
我的build.xml有以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<project name="myProject" default="all">
<taskdef resource="com/worklight/ant/defaults.properties">
<classpath>
<pathelement location="/Applications/IBM/Worklight-CLI/public/worklight-ant-builder.jar"/>
</classpath>
</taskdef>
<target name="all">
<war-builder projectfolder="."
destinationfolder="bin/war"
warfile="bin/project.war"
classesFolder="classes-folder"/>
</target>
</project>
当我执行Ant脚本时,它会抛出以下错误:
[taskdef]无法从资源加载定义com/worklight/ant/defaults.properties。找不到它。
您提到您正在使用MFP 6.3,但在XML中您指向的是"Worklight CLI",它不是MFP 6.3而是6.2或更高版本。你确定你真的在用MFP6.3吗
它也指CLI。您确定要使用CLI吗?不,在您的问题中,您在哪里提到CLI。。。
- 验证您是否安装了要使用的正确版本
- 一旦安装了正确的版本,请将location属性更改为:
location="/Applications/IBM/MobileFirst CLI/MobileFirst-CLI/nod_module/generator worklight server/ant tools/worklight ant builder.jar"