2015-03-02 45 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