如何用ANT脚本安装weblogic

如何用ANT脚本安装weblogic


<target name=”installWebLogic10MP1″ description=”install weblogic 10 MP1″>
<available file=”${java.tools.home}/weblogic/server1001_linux32.bin” type=”file” property=”weblogic.linux.binary”/>

//检测weblogic安装文件
<available file=”${java.tools.home}/weblogic/server1001_win32.exe” type=”file” property=”weblogic.windows.binary”/>
<if>
<equals arg1=”${os.name}” arg2=”Linux”/>

、、检测操作系统类型
<then>
<if>
<equals arg1=”${weblogic.linux.binary}” arg2=”true”/>
<else>
<mkdir dir=”${java.tools.home}/weblogic”/>
<get src=”安装文件目录” dest=”${java.tools.home}/weblogic/server1001_linux32.bin” verbose=”true”/>
<chmod file=”${java.tools.home}/weblogic/server1001_linux32.bin” perm=”777″/>
</else>
</if>
</then>
<else>
<if>
<equals arg1=”${weblogic.windows.binary}” arg2=”true”/>
<else>
<mkdir dir=”${java.tools.home}/weblogic”/>
<get src=”weblogic安装文件url” dest=”保存安装文件的目录” verbose=”true”/>
</else>
</if>
</else>
</if>
<resourcecount property=”bea.files”>
<fileset dir=”${env.BEA_HOME}”/>
</resourcecount>
<if>
<equals arg1=”${bea.files}” arg2=”0″/>
<else>
<input message=”You’re BEA_HOME directory is not empty and it needs to be for a successful webLogic 10 installation. Would you like me to clean it for you?” validargs=”y,n” addproperty=”do.delete”/>
<if>
<equals arg1=”${do.delete}” arg2=”y”/>
<then>
<delete includeemptydirs=”true”>
<fileset dir=”${env.BEA_HOME}” includes=”**/*”/>
</delete>
</then>
<else>

<fail message=”You have not met the requirements to install webLogic 10. Please either select a pristine BEA_HOME or remove what is currently in your BEA_HOME.”/>
</else>
</if>
</else>
</if>
<antcall target=”replaceSilentInstallProperties10″/>
<if>
<equals arg1=”${os.name}” arg2=”Linux”/>
<then>
<exec executable=”${java.tools.home}/weblogic/server1001_linux32.bin”>
<arg value=”-mode=silent”/>
<arg value=”-silent_xml=${gen.src.project}/weblogic/silent.xml”/>
</exec>
<delete file=”${java.tools.home}/weblogic/server1001_linux32.bin”/>
</then>
<else>
<exec executable=”${java.tools.home}/weblogic/server1001_win32.exe”>
<arg value=”-mode=silent”/>
<arg value=”-silent_xml=${gen.src.project}/weblogic/silent.xml”/>
</exec>
<delete file=”${java.tools.home}/weblogic/server1001_win32.exe”/>
</else>
</if>
</target>

<target name=”replaceSilentInstallProperties10″ description=”replace tokens in the webLogic silent.xml file”>
<delete dir=”${gen.src.project}/weblogic”/>
<mkdir dir=”${gen.src.project}/weblogic”/>
<copy file=”${resource.weblogic}/10/tokenized.silent.xml” tofile=”${gen.src.project}/weblogic/silent.xml”/>
<replace file=”${gen.src.project}/weblogic/silent.xml” token=”BEA-HOME-NEEDS-TO-BE-SET” value=”${bea.home}”/>
<replace file=”${gen.src.project}/weblogic/silent.xml” token=”WEBLOGIC-HOME-NEEDS-TO-BE-SET” value=”${weblogic.home}”/>
</target>


来自我的小站 www.threes.cn


你可能感兴趣的:(java,linux,weblogic,ant,脚本)