failonerror="false" /> <!-- Invoke listapps target to list installed applications. --> <antcall target="listapps" /> </target> <target name="installapp" depends="uninstallapp"> <!-- Define the wsInstallApp task that installs an Enterprise Application. --> <taskdef name="wsInstallApp" classname="com.ibm.websphere.ant.tasks.InstallApplication"> <!-- Include all JAR files under WebSphere Application Server lib directory. --> <classpath> <fileset dir="${was.home}/lib/" includes="*.jar" /> </classpath> </taskdef> <!-- Install an Enterprise Application under the profile specified. --> <wsInstallApp profilename="${was.profilename}" wasHome="${was.home}/"
ear="${destination.dir} /${project.name}.ear" conntype="SOAP"
host="${was.hostname}" port="${was.hostport}" user="${was.username}"
password="${was.userpassword}" failonerror="false" /> <!-- Invoke listapps target to list installed applications. --> <antcall target="listapps" /> </target>
根據需要部署的應用程序的數量不同,可以使用 project.name 參數的不同值多次調用 installapp
目標。installapp
目標將調用 uninstallapp
目標來確保企業應用程序已經卸載(如果已安裝)。兩個目標多次調用 listapps
,以在卸載和安裝前后列出應用程序。清單 11 說明了如何進行此工作。
文章來源于領測軟件測試網 http://www.kjueaiud.com/