usful links

<project name="deploy" basedir="..">
	<!-- 環境に関する変数 -->
	<property name="wls.home" value="D:\bea\weblogic92" />
	<property name="wls.username" value="weblogic" />
	<property name="wls.password" value="weblogic" />
	<property name="wls.hostname" value="localhost" />
	<property name="wls.port" value="7001" />
	<property name="wls.server.name" value="AdminServer" />
	<property name="setWLSEnv" value="${wls.home}/server/bin/setWLSEnv.cmd" />
	<property name="ear.dir" value="D:\deploy\4.1" />

	<!-- weblogicのjar -->
	<path id="weblogic.jar">
		<pathelement location="${wls.home}\server\lib\weblogic.jar" />
		<pathelement location="${wls.home}\server\lib\webservices.jar" />
	</path>

	<taskdef name="wldeploy"
		classname="weblogic.ant.taskdefs.management.WLDeploy"
		classpathref="weblogic.jar" />

	<target name="common">
		<ant antfile="${basedir}/CoSMO_o_utility/build.xml" target="build.jar" inheritall="no" />
		<ant antfile="${basedir}/CoSMO_o_common_DAO/build.xml" target="build.jar" inheritall="no" />
		<ant antfile="${basedir}/CoSMO_o_common_EJB/build.xml" target="build.jar" inheritall="no" />
		<ant antfile="${basedir}/CoSMO_o_control/build.xml" target="build.jar" inheritall="no" />
	</target>

	<target name="deployCoSMO_o_pc">
		<property name="service.name" value="CoSMO_o_pc" />
		<antcall target="undeploy" />
		<antcall target="deploy" />
	</target>

	<target name="deployCoSMO_o_common">
		<property name="service.name" value="CoSMO_o_common" />
		<antcall target="undeploy" />
		<antcall target="deploy" />
	</target>

	<target name="updateCoSMO_o_pc" depends="common">
		<property name="service.name" value="CoSMO_o_pc" />
		<property name="service.name" value="CoSMO_o_pc" />
		<echo>copy jsps...</echo>
		<copy todir="${ear.dir}/${service.name}/${service.name}_Web" flatten="false" overwrite="true">
			<fileset dir="${basedir}/CoSMO_o_pc_Web/WebContent">
				<include name="**/*.jsp" />
			</fileset>
		</copy>
		<echo>copy classes...</echo>
		<copy todir="${ear.dir}/${service.name}/${service.name}_Web/WEB-INF/classes" flatten="false" overwrite="true">
			<fileset dir="${basedir}/CoSMO_o_pc_Web/build/classes">
				<include name="**/*.class" />
			</fileset>
		</copy>
		<copy file="${basedir}/CoSMO_o_utility/build/CoSMO_o_utility.jar"
					todir="${ear.dir}/${service.name}/${service.name}_Web/WEB-INF/lib" overwrite="true"/>
		<copy file="${basedir}/CoSMO_o_common_EJB/build/CoSMO_o_common_EJB-client.jar"
					todir="${ear.dir}/${service.name}/${service.name}_Web/WEB-INF/lib" overwrite="true"/>
		<copy file="${basedir}/CoSMO_o_control/build/CoSMO_o_control.jar"
					todir="${ear.dir}/${service.name}/${service.name}_Web/WEB-INF/lib" overwrite="true"/>
		<antcall target="redeploy" />
	</target>

	<target name="updateCoSMO_o_common" depends="common">
		<property name="service.name" value="CoSMO_o_common" />
		<copy file="${basedir}/CoSMO_o_utility/build/CoSMO_o_utility.jar"
					todir="${ear.dir}/${service.name}/APP-INF/lib" overwrite="true"/>
		<copy file="${basedir}/CoSMO_o_common_DAO/build/CoSMO_o_common_DAO.jar"
					todir="${ear.dir}/${service.name}/APP-INF/lib" overwrite="true"/>
		<copy file="${basedir}/CoSMO_o_control/build/CoSMO_o_control.jar"
					todir="${ear.dir}/${service.name}/APP-INF/lib" overwrite="true"/>
		<antcall target="redeploy"></antcall>
	</target>

	<target name="deploy">
		<wldeploy action="deploy"
			name="${service.name}"
			source="${ear.dir}\${service.name}"
			user="${wls.username}"
			password="${wls.password}"
			verbose="true"
			adminurl="t3://${wls.hostname}:${wls.port}"
			targets="${wls.server.name}" />
	</target>

	<target name="undeploy">
		<wldeploy action="undeploy"
		name="${service.name}"
		failonerror="false"
		user="${wls.username}"
		password="${wls.password}"
		verbose="true"
		adminurl="t3://${wls.hostname}:${wls.port}"
		targets="${wls.server.name}" />
	</target>

	<target name="redeploy">
		<wldeploy action="redeploy"
			name="${service.name}"
			source="${ear.dir}\${service.name}"
			user="${wls.username}"
			password="${wls.password}"
			verbose="true"
			adminurl="t3://${wls.hostname}:${wls.port}"
			targets="${wls.server.name}" />
	</target>

</project>
 

tomcat 源码分析:  http://toking79.iteye.com/

 

weblogic auto deploy ant build.xml

 

 

 

你可能感兴趣的:(tomcat)