构建和使用Ant生成器部署IBM MobileFirst平台6.3适配器 [英] Build and deploy IBM MobileFirst Platform 6.3 adapters using Ant Builder
问题描述
我试图建立和上MobileFirst服务器部署从我的蚂蚁的build.xml适配器,但是当我试图访问code的下方线条ant.It引发我一个错误。
错误:
无法加载从资源定义
COM /工作灯/ ANT /建设者/ defaults.properties。它不能被发现。
code:
<的taskdef资源=COM /工作灯/ ANT /建设者/ defaults.properties>
<&类路径GT;
< pathelement
location=\"/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools/worklight-ant-builder.jar\" />
< /类路径>
< /&的taskdef GT;
部署应用程序
我相信你的资源
值不正确。
尝试改变:
<的taskdef资源=COM /工作灯/ ANT /建设者/ defaults.properties>
要:
<的taskdef资源=COM /工作灯/ ANT / defaults.properties>
我曾与下面的脚本测试,它为我工作:
<?XML版本=1.0编码=UTF-8&GT?;
<项目的basedir =。默认值=目标名称>
<的taskdef资源=COM /工作灯/ ANT / defaults.properties>
<&类路径GT;
< pathelement location=\"/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools/worklight-ant-builder.jar\"/>
< /类路径>
< /&的taskdef GT;
<目标名称=目标名称>
<应用建设者
worklightserverhost =HTTP://我的IP地址的:10080
applicationFolder=\"/Users/idanadar/Documents/MobileFirst/Eclipses/workspaces/6300/my-project-name/apps/my-app-name\"
环境=普遍,iphone
nativeProject preFIX =我的项目名称
outputFolder =/用户/ idanadar /桌面/>
< /目标与GT;
< /项目>
注意:的到.jar文件应该是<一个建设者路径href=\"http://www-01.ibm.com/support/knowledgecenter/SSHS8R_6.3.0/com.ibm.worklight.deploy.doc/devref/r_ant_tasks_buld_deploy_apps.html?lang=en\"相对=nofollow>作为文档但是我说,至少我收到了同样的错误,除非使用在问题中提到的相同的路径。
结果
部署适配器
与下面的模板尝试(用自己的改变所需的值):
&LT;?XML版本=1.0编码=UTF-8&GT?;
&LT;项目的basedir =。默认值=目标名称&GT;
&LT;的taskdef资源=COM /工作灯/ ANT /部署者/ antlib.xml&GT;
&LT;&类路径GT;
&LT;! - 其更改为工作灯-ANT-deployer.jar中的可用路径
服务器安装文件夹 - &GT;
&LT; pathelement location=\"/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/worklight-ant-deployer.jar\"/>
&LT; /类路径&GT;
&LT; /&的taskdef GT;
&lt;目标名称=目标名称&GT;
&LT;! - 如果您的控制台是安全的,去掉安全=false的属性 - &GT;
&LT; wladm URL =我的IP地址的:10080 / worklightadmin安全=false的用户=admin的密码=admin的&GT;
&LT;部署适配器运行=我的项目名文件=我的适配器-name.adapter/&GT;
&LT; / wladm&GT;
&LT; /目标与GT;
&LT; /项目&GT;
I am trying build and deploy adapters from my ant build.xml on to MobileFirst Server,but when i am trying to access the below lines of code in ant.It throws me an error.
Error: Could not load definitions from resource com/worklight/ant/builders/defaults.properties. It could not be found.
Code:
<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>
Deploy application
I believe your resource
value is incorrect.
Try changing:
<taskdef resource="com/worklight/ant/builders/defaults.properties">
To:
<taskdef resource="com/worklight/ant/defaults.properties">
I have tested with the below script and it worked for me:
<?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>
Note: The path to the builder .jar file should be as stated in the documentation, however for me at least I received the same error unless using the same path as mentioned in the question.
Deploy adapter
Try with the below template (change the required values with your own):
<?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>
这篇关于构建和使用Ant生成器部署IBM MobileFirst平台6.3适配器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!