yashwanth balaji
yashwanth balaji

Reputation: 99

MobileFirst Building a project WAR file with Ant

I am trying to build the project .war file with Ant in MobileFirst Platform 6.3.

my build.xml has the following:

<?xml version="1.0" encoding="UTF-8"?>
    <project name="myProject" default="all">
        <taskdef resource="com/worklight/ant/defaults.properties">
            <classpath>
                <pathelement location="/Applications/IBM/Worklight-CLI/public/worklight-ant-builder.jar"/>
            </classpath>
        </taskdef>
        <target name="all">
            <war-builder projectfolder="."
                destinationfolder="bin/war"
                warfile="bin/project.war"
            classesFolder="classes-folder"/>
       </target>
   </project>

When I execute the Ant script it throws the following error:

[taskdef] Could not load definitions from resource com/worklight/ant/defaults.properties. It could not be found.

Upvotes: 0

Views: 259

Answers (1)

Idan Adar
Idan Adar

Reputation: 44516

You mention that you are using MFP 6.3, but in your XML you are pointing to "Worklight-CLI", which is not MFP 6.3, but 6.2 or older. Are you sure you're really using MFP 6.3?
It is also referring to the CLI. Are you certain you intend to use the CLI? No where in your question do you mention the CLI...

  1. Verify you have installed the correct version of what you intend to use
  2. Once you've installed the correct version, change the location attribute to:

location="/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools/worklight-ant-builder.jar"

Upvotes: 1

Related Questions