2013-09-23 59 views
0

我正在使用Ant將我的應用程序部署到生產應用程序服務器(WebSphere)。 我使用位於$ {WORKLIGHT_INSTALL_DIR} \ configuration-samples文件夾中的示例配置文件。該配置文件被標記爲適用於Websphere Liberty和Apache derby。 在配置部分,我更改路徑元素標記(在代碼報告下方)的值(並且僅根據文檔IBM提供此值)。使用Ant任務部署Worklight應用程序

<taskdef resource="com/worklight/ant/defaults.properties"> 
<classpath> 
    <pathelement location="C:\workspace\jQueryMobileApplication\bin\jQueryMobileApplication.war"/> 
</classpath> 

設置的位置我的應用程序戰爭的道路。 build.xml文件位於我的項目的war文件的同一個文件夾中。 當我鍵入命令:

ant -f <filename>.xml 

我得到這個異常:

Buildfile: C:\IBM\WorklightSRV\WorklightServer\configure-liberty-derby.xml 
[taskdef] Could not load definitions from resource com/worklight/ant/defaults.properties. It could not be found. 

我與工作燈開發一個新手(也使用Ant部署),所以我感謝所有幫助,即使這可能是一個微不足道的問題。

回答

1

該類路徑用於worklight-ant.jar來定義任務到螞蟻 前。

<taskdef resource="com/worklight/ant/defaults.properties"> 
    <classpath> 
     <pathelement location="./lib/worklight-ant.jar" /> 
    </classpath> 
</taskdef> 

後的Ant任務被加載,你可以使用的工作燈Ant任務一做你的命令 前。

<echo>Export war file</echo> 
     <war-builder projectfolder="./<ProjectDirectory>" destinationfolder="bin/war" warfile="bin/Application.war.${env}" classesFolder="<ProjectDirectory>/bin/classes" /> 

從我知道這會爲你創建戰爭,但你將不得不手動部署它。

+0

謝謝你tik27,我改變了這些東西,現在我可以建立它。無論如何,我面臨着另一個問題,我沒有設置'websphereappserverserver installdir',所以它的值仍然是默認值(即/n/java/webservers/was-liberty-8.5-express)。我應該在哪個應用程序服務器的文件夾中安裝應用程序? – Riccardo

+0

我嘗試過使用C:\ Programfiles \ IBM \ WebSphere \ AppServer或C:\ Programfiles \ IBM \ WebSphere \ AppServer \ newApp,但它不起作用 – Riccardo

+0

您是否運行完整的Websphere或Websphere Liberty? – tik27

相關問題