我正在尝试构建并部署从ant build.xml到MobileFirst服务器的适配器,但是当我试图访问ant.It中的以下代码行时,会引发一个错误。
错误:无法从资源com/worklight/ant/builders/defaults.properties.加载定义找不到了。
代码:
<taskdef resource="com/worklight/ant/builders/defaults.properties">
<classpath>
<pathelement
location="/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools/worklight-ant-builder.jar" />
</classpath>
</taskdef>发布于 2014-12-15 06:38:32
部署应用程序
我相信你的resource值是不正确的。
试着改变:
<taskdef resource="com/worklight/ant/builders/defaults.properties">至:
<taskdef resource="com/worklight/ant/defaults.properties">我已经用下面的脚本进行了测试,它对我起了作用:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="target-name">
<taskdef resource="com/worklight/ant/defaults.properties">
<classpath>
<pathelement location="/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools/worklight-ant-builder.jar"/>
</classpath>
</taskdef>
<target name="target-name">
<app-builder
worklightserverhost="http://my-ip-address:10080"
applicationFolder="/Users/idanadar/Documents/MobileFirst/Eclipses/workspaces/6300/my-project-name/apps/my-app-name"
environments="common,iphone"
nativeProjectPrefix="my-project-name"
outputFolder="/Users/idanadar/Desktop"/>
</target>
</project>注意:构建器.jar文件的路径应该是如文件所述,但是至少对我来说,我收到了相同的错误,除非使用问题中提到的相同的路径。
部署适配器
尝试使用以下模板(用自己的模板更改所需的值):
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="target-name">
<taskdef resource="com/worklight/ant/deployers/antlib.xml">
<classpath>
<!-- Change this to the path of the worklight-ant-deployer.jar available in the
server installation folder -->
<pathelement location="/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/worklight-ant-deployer.jar"/>
</classpath>
</taskdef>
<target name="target-name">
<!-- if your console is secure, remove the 'secure="false"' attribute -->
<wladm url="my-ip-address:10080/worklightadmin" secure="false" user="admin" password="admin">
<deploy-adapter runtime="my-project-name" file="my-adapter-name.adapter"/>
</wladm>
</target>
</project>https://stackoverflow.com/questions/27474639
复制相似问题