2015-03-02 48 views
0

我正尝试在MobileFirst Platform 6.3中使用Ant构建项目.war文件。MobileFirst使用Ant构建项目WAR文件

我的build.xml有以下几点:

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

当我执行它引发以下错误Ant脚本:

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

回答

1

你提到您正在使用MFP 6.3,但在你的XML指向“Worklight-CLI”,即而不是 MFP 6.3,但6.2或更早版本。你确定你真的使用MFP 6.3吗?
它也指CLI。你确定你打算使用CLI吗?无论在哪里你的问题,你提到的CLI ...

  1. 确认您已经安装了要使用
  2. 一旦你安装了正确的版本,改变位置属性是什么正确的版本:

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

+0

好的。我知道了。如果我只是想从MobileFirst 6.3构建应用程序,使用Ant,我该怎么做? – 2015-03-02 07:19:32

+0

正是我写的。以下是文档主题:https://www-01.ibm.com/support/knowledgecenter/SSHS8R_6.3.0/com.ibm.worklight.deploy.doc/devref/r_ant_tasks_deploy_projects.html – 2015-03-02 07:22:23