Build and deploy IBM MobileFirst Platform 6.3 adapters using Ant Builder

后端 未结 1 1941
半阙折子戏
半阙折子戏 2021-01-28 04:56

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.

<
相关标签:
1条回答
  • 2021-01-28 05:00

    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>
    
    0 讨论(0)
提交回复
热议问题