【问题标题】:Build and deploy IBM MobileFirst Platform 6.3 adapters using Ant Builder使用 Ant Builder 构建和部署 IBM MobileFirst Platform 6.3 适配器
【发布时间】:2014-12-15 20:49:39
【问题描述】:

我正在尝试从我的 ant build.xml 构建和部署适配器到 MobileFirst Server,但是当我尝试访问 ant 中的以下代码行时,它会抛出一个错误。

错误: 无法从资源加载定义 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>

【问题讨论】:

    标签: ant ibm-mobilefirst


    【解决方案1】:

    部署应用程序

    我认为您的 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 文件的路径应该是 as stated in the documentation,但至少对我来说,除非使用问题中提到的相同路径,否则我会收到相同的错误。


    部署适配器

    尝试使用以下模板(用您自己的更改所需的值):

    <?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>
    

    【讨论】:

    • 但是当我尝试部署适配器时,它显示错误:“访问localhost:10080/sample/management-apis/1.0/runtimes/…时出错:HTTP/1.1 404 Not Found”你能帮我解决这个问题吗
    • 我尝试了相同的代码 Idan 。但仍然收到此错误 我尝试了几种方法来解决此问题,按照link,但仍然面临同样的问题..
    • 提供您的完整脚本。
    • 请通过这个[github链接](gist.github.com/futur/1b70483da2d8c33f1262)for我的蚂蚁脚本
    • 这是一项艰巨的任务。你为什么不创建一个示例来部署 1 个适配器,让它工作,然后修改这个巨大的野兽...... :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-13
    • 1970-01-01
    • 2020-04-08
    相关资源
    最近更新 更多