這個主題說明如何使用 ANT 作業,將應用程式自動部署到 WebSphere ESB。 利用 ANT 作業,您可以定義多個應用程式的部署, 並使其在伺服器上自動執行。
開發及測試應用程式的相關資訊,位於 WebSphere® Integration Developer 6.0 版的「資訊中心」中。
WebSphere Application Server 6.0 版資訊中心的參考資料部分,含有關於應用程式設計介面的段落。您可以在 com.ibm.websphere.ant.tasks 套件中找到 ANT 作業的說明。 與這個主題有關的作業是 ServiceDeploy 和 InstallApplication。
<?xml version="1.0"> <project name="OwnTaskExample" default="main" basedir="."> <taskdef name="servicedeploy" classname="com.ibm.websphere.ant.tasks.ServiceDeployTask" /> <target name="main" depends="main2"> <servicedeploy scaModule="c:/synctest/SyncTargetJAR" ignoreErrors="true" outputApplication="c:/synctest/SyncTargetEAREAR" workingDirectory="c:/synctest" noJ2eeDeploy="true" cleanStagingModules="true"/> </target> </project>
${WAS}/bin/ws_ant -f myBuildScript.xml