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 说明了如何进行此工作。
文章来源于领测软件测试网 https://www.ltesting.net/