user2449016
user2449016

Reputation: 169

Build a IBM MobileFirst adapter with ant in windows

Im using MobileFirst 6.3 and wrote following ant Build.xml in Windows 7 I have the lastest CLI installed.

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="adapter">
  <taskdef resource="com/worklight/ant/defaults.properties">
    <classpath>
      <pathelement location="C:\Tools\IBM\MobileFirst-CLI\mobilefirst-cli\node_modules\generator-worklight-server\lib\worklight-ant-deployer.jar"/>
    </classpath>
  </taskdef>
  <target name="adapter">
    <adapter-builder
        folder="C:\pruebas\adapters\adapter"
        destinationfolder="C:\pruebas\bin"/>
    </target>
</project>

When I execute the task with following command "ant adapter" it gives me following error :

C:\pruebas\ANT>ant adapter
Buildfile: C:\pruebas\ANT\build.xml

adapter:

BUILD FAILED
C:\pruebas\ANT\build.xml:11: Problem: failed to create task or type adapter-buil
der
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.


Total time: 0 seconds

Any help?

Upvotes: 0

Views: 124

Answers (1)

Idan Adar
Idan Adar

Reputation: 44516

You say you are trying to build an adapter using Ant, yet you are pointing to the adapter deployer .jar file...

See the following user documentation topic: https://www-01.ibm.com/support/knowledgecenter/SSHS8R_6.3.0/com.ibm.worklight.deploy.doc/devref/r_ant_tasks_buld_deploy_apps.html

You should try pointing to either:

  • C:\Tools\IBM\MobileFirst-CLI\public\worklight-ant-builder.jar, or to
  • C:\Tools\IBM\MobileFirst-CLI\mobilefirst-cli\node_modules\generator-worklight-server\lib\worklight-ant-builder.jar

Upvotes: 1

Related Questions