<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
  <channel>
    <title>Huaqingfly</title>
    <description></description>
    <link>http://huaqingfly.javaeye.com</link>
    <language>UTF-8</language>
    <copyright>Copyright 2003-2008, JavaEye.com</copyright>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>JavaEye - 做最棒的软件开发交流社区</generator>
      <item>
        <title>web service build.xml</title>
        <author>Huaqingfly</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://huaqingfly.javaeye.com">Huaqingfly</a>&nbsp;
          链接：<a href="http://huaqingfly.javaeye.com/blog/66698" style="color:red;">http://huaqingfly.javaeye.com/blog/66698</a>&nbsp;
          发表时间: 2007年03月30日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          &lt;project name="ParaDM" default="compile" basedir="."><br /><br />  &lt;property environment="env" value="dummy"/><br /><br />  &lt;!-- Tomcat home directory --><br />  &lt;property name="tomcat.home" value="${env.TOMCAT_HOME}"/><br />  &lt;!-- WAR home directory --><br />  &lt;property name="war.home" value="${basedir}/../build" /><br /><br />  &lt;!-- Tomcat home directory --><br />  &lt;property name="tomcat.service" value="Apache Tomcat 4.1"/><br /><br />  &lt;property name="webapp.locale" value="en_US"/><br />  &lt;property name="webapp.temp.resources" value="../temp/resources"/><br />  &lt;property name="webapp.temp.classes" value="../temp/classes"/><br />  &lt;property name="webapp.temp.lib" value="../temp/lib"/><br />  &lt;property name="webapp.temp.wsapi" value="../temp/wsapi"/><br />  &lt;property name="webapp.temp.services" value="../temp/services"/><br />  &lt;property name="webapp.temp.war" value="../temp"/><br />  &lt;tstamp><br />    &lt;format property="timestamp" pattern="yyyyMMdd" locale="en"/><br />  &lt;/tstamp> <br /><br />  &lt;!-- ParaDM web context name --><br />  &lt;property name="webapp.name" value="ParaDM"/><br /><br />  &lt;!-- ParaDM version number --><br />  &lt;property name="webapp.version" value="3.1.8"/><br /><br />  &lt;!-- Source file location --><br />  &lt;property name="java.src" value="${basedir}"/><br /><br />  &lt;!-- Web file location --><br />  &lt;property name="webapp.src" value="${basedir}/../web"/><br /><br />  &lt;!-- Applicaton library location --><br />  &lt;property name="webapp.lib" value="${webapp.src}/WEB-INF/lib"/><br /><br />  &lt;!-- Build result location --><br />  &lt;property name="build.dir" value="${webapp.src}/WEB-INF/"/><br /><br />  &lt;!-- JavaDoc location --><br />  &lt;property name="build.javadoc.dir" value="${basedir}/../doc/java"/><br />  &lt;property name="build.tlddoc.dir" value="${basedir}/../doc/tld"/><br />  &lt;property name="build.jsdoc.dir" value="${basedir}/../doc/js"/><br />  &lt;property name="build.jsdoc.pl" value="D:/Projects/JSDoc-1.9.9.2/jsdoc.pl"/><br />  <br />  &lt;!-- Database Administrator login--><br />  &lt;property name="database.dba.login" value="root"/><br />  <br />  &lt;!-- Database Administrator password--><br />  &lt;property name="database.dba.password" value=""/>  <br /><br />  &lt;!-- Database ParaDM user login name --><br />  &lt;property name="database.user.login"    value="paradm"/><br />  <br />  &lt;!-- Database ParaDM user password--><br />  &lt;property name="database.user.password" value="paradm"/><br /><br />  &lt;!-- Database Location --><br />  &lt;property name="database.location" value="localhost"/><br />  <br />  &lt;!-- Database instance name --><br />  &lt;property name="database.sid" value="ParaDM"/>    <br />  <br />  &lt;!-- Directories to store the Web Service generated files --><br />  &lt;property name="wsapi.dir" value="${webapp.temp.wsapi}"/>  <br />  &lt;property name="wsapi.classes" value="${wsapi.dir}/build/classes"/>  <br />  &lt;property name="wsapi.lib" value="${wsapi.dir}/build/lib"/>  <br /><br />  &lt;condition property="paradm.home.file" value="D:/ParaDM/file"><br />    &lt;os family="windows"/><br />  &lt;/condition><br /><br />  &lt;condition property="paradm.home.file" value="/usr/local/bin/ParaDM/file"><br />    &lt;os family="unix"/><br />  &lt;/condition><br /><br />  &lt;!-- Set classpath --><br />  &lt;path id="build.classpath"><br />    &lt;fileset dir="../lib"><br />      &lt;include name="**/*.jar"/><br />    &lt;/fileset><br />    &lt;fileset dir="${webapp.lib}"><br />      &lt;include name="**/*.jar"/><br />    &lt;/fileset><br />    &lt;fileset dir="${tomcat.home}"><br />      &lt;include name="**/servlet.jar"/><br />      &lt;include name="**/mail.jar"/><br />      &lt;include name="**/activation.jar"/><br />    &lt;/fileset><br />  &lt;/path><br /><br />  &lt;taskdef name="foreach" classname="net.sf.antcontrib.logic.ForEach" classpath="../lib/ant-contrib-1.0b3.jar"/><br />  &lt;taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" classpath="../lib/ant-contrib-1.0b3.jar"/><br /><br />  &lt;!-- Command for compile source and resources files [DEFAULT] --><br />  &lt;target name="compile"><br />    &lt;echo>Build Begin ... ${basedir}&lt;/echo><br />    &lt;antcall target="compile_src"/><br />    &lt;antcall target="compile_res"/><br />    &lt;antcall target="copy_class"/><br />    &lt;antcall target="copy_properties"/><br />    &lt;antcall target="copy_others"/><br />  &lt;/target><br /><br />  &lt;!-- Command for compile java files --><br />  &lt;target name="compile_src"><br />    &lt;!-- ========================================================================= --><br />    &lt;!-- Compile the Axis2/XMLBeans generated classes into JAR file (paradm-ws-api.jar)                                        --><br />    &lt;!-- ========================================================================= --><br />    &lt;antcall target="wsapi"/><br />    &lt;copy todir="${webapp.temp.classes}"><br />      &lt;fileset dir="${java.src}"><br />      	&lt;include name="*.properties"/><br />      	&lt;exclude name="generate.properties"/><br />      &lt;/fileset><br />    &lt;/copy><br />    &lt;javac srcdir="${java.src}" destdir="${webapp.temp.classes}" debug="on" memoryInitialSize="128m" memoryMaximumSize="256m" fork="true"><br />      &lt;classpath refid="build.classpath"/><br />      &lt;classpath location="${wsapi.lib}/paradm-ws-api.jar"/><br />      &lt;exclude name="com/dcivision/customize/**"/><br />    &lt;/javac><br />    &lt;!-- ========================================================================= --><br />    &lt;!-- Compile and package different web services (WS-ParaDM.aar, WS-ParaDOC.aar, etc)                                  --><br />    &lt;!-- ========================================================================= --><br />    &lt;antcall target="wsaar"/><br />  &lt;/target><br /><br />  &lt;!-- Command for compile resources files --><br />  &lt;target name="compile_res" depends="res.chkUpToDate" unless="res.notRequired"><br />    &lt;mkdir dir="${webapp.temp.resources}"/><br />    &lt;copy overwrite="true" todir="${webapp.temp.resources}"><br />      &lt;fileset dir="${java.src}"><br />        &lt;include name="**/*Resource*.properties"/><br />      &lt;/fileset><br />    &lt;/copy><br />    &lt;copy overwrite="true" file="${webapp.temp.resources}/com/dcivision/resource/ApplicationResources.properties" tofile="${webapp.temp.resources}/com/dcivision/resource/ApplicationResources_${webapp.locale}.properties"/><br />    &lt;copy overwrite="true" file="${webapp.temp.resources}/com/dcivision/resource/CustomizedResources.properties" tofile="${webapp.temp.resources}/com/dcivision/resource/CustomizedResources_${webapp.locale}.properties"/><br />    &lt;native2ascii encoding="utf-8" src="${webapp.temp.resources}" dest="${build.dir}/classes" includes="**/*Resource*.properties" /><br />  &lt;/target><br /><br />  &lt;target name="res.chkUpToDate"><br />    &lt;echo message="Checking resources bundles for update"/><br />    &lt;uptodate property="res.notRequired"><br />      &lt;srcfiles dir="${java.src}" includes="**/*Resource*.properties"/><br />      &lt;mapper type="glob" from="*.properties" to="${webapp.temp.resources}/*.properties" /><br />    &lt;/uptodate><br />    &lt;if><br />      &lt;istrue value="${res.notRequired}"/><br />      &lt;then>&lt;echo message="Resources bundles up to date: ${res.notRequired}"/>&lt;/then><br />    &lt;/if><br />  &lt;/target><br /><br />  &lt;target name="copy_class"><br />    &lt;copy todir="${build.dir}/classes"><br />      &lt;fileset dir="${webapp.temp.classes}"><br />        &lt;exclude name="**/*Resource*.properties"/><br />        &lt;exclude name="*.properties"/><br />        &lt;exclude name="com/dcivision/ws/**/**"/><br />      &lt;/fileset><br />    &lt;/copy><br />  &lt;/target><br /><br />  &lt;target name="copy_properties"><br />    &lt;copy todir="${build.dir}/classes"><br />      &lt;fileset dir="${webapp.temp.classes}"><br />      	&lt;include name="*.properties"/><br />      	&lt;exclude name="generate.properties"/><br />      &lt;/fileset><br />    &lt;/copy><br />  &lt;/target><br /><br />  &lt;target name="copy_others"><br />    &lt;copy file="${java.src}/com/dcivision/workflow/action/AutoTaskTemplate.java" todir="${build.dir}/classes/com/dcivision/workflow/action"/><br />  &lt;/target><br /><br />  &lt;!-- Build Web Application war package --><br />  &lt;target name="buildwar"  depends="compile"><br />	&lt;mkdir dir="${war.home}"/><br />	&lt;war destfile="${war.home}/eip.war" webxml="${webapp.src}/WEB-INF/web.xml"><br />	   &lt;fileset dir="${webapp.src}"><br />	      &lt;exclude name="${webapp.src}/WEB-INF/web.xml"/><br />	   &lt;/fileset><br />    &lt;/war><br />  &lt;/target><br />	<br />  &lt;!-- Command for deployment --><br />  &lt;target name="deploy" depends="compile"><br />    &lt;copy todir="${tomcat}"><br />      &lt;fileset dir="${classes}"/><br />    &lt;/copy><br />    &lt;copy todir="${jsp}"><br />      &lt;fileset dir="${src}/com/dcivision/dms/web/jsp"/><br />    &lt;/copy><br />  &lt;/target><br /><br />  &lt;!-- Command for generation of JavaDoc --><br />  &lt;target name="javadoc" depends="compile"><br />    &lt;javadoc packagenames="com.dcivision.alert,com.dcivision.alert.bean,com.dcivision.alert.core,com.dcivision.alert.dao,com.dcivision.alert.web,com.dcivision.audit,com.dcivision.audit.bean,com.dcivision.audit.core,com.dcivision.audit.dao,com.dcivision.calendar,com.dcivision.calendar.bean,com.dcivision.calendar.dao,com.dcivision.calendar.taglib,com.dcivision.calendar.web,com.dcivision.contact,com.dcivision.contact.bean,com.dcivision.contact.dao,com.dcivision.contact.web,com.dcivision.customize,com.dcivision.customize.workflow,com.dcivision.dms,com.dcivision.dms.bean,com.dcivision.dms.client,com.dcivision.dms.client.analyzer,com.dcivision.dms.client.parser,com.dcivision.dms.core,com.dcivision.dms.dao,com.dcivision.dms.extractor,com.dcivision.dms.taglib,com.dcivision.dms.web,com.dcivision.form,com.dcivision.form.bean,com.dcivision.form.core,com.dcivision.form.dao,com.dcivision.form.web,com.dcivision.forum,com.dcivision.forum.bean,com.dcivision.forum.core,com.dcivision.forum.dao,com.dcivision.forum.web,com.dcivision.framework,com.dcivision.framework.bean,com.dcivision.framework.dao,com.dcivision.framework.image,com.dcivision.framework.notification,com.dcivision.framework.taglib.bean,com.dcivision.framework.taglib.calendar,com.dcivision.framework.taglib.html,com.dcivision.framework.taglib.layout,com.dcivision.framework.taglib.logic,com.dcivision.framework.taglib.newCalender,com.dcivision.framework.web,com.dcivision.framework.xml,com.dcivision.ldap.core,com.dcivision.ldap.web,com.dcivision.mail.bean,com.dcivision.mail.core,com.dcivision.mail.dao,com.dcivision.mail.web,com.dcivision.setup,com.dcivision.setup.bean,com.dcivision.setup.dao,com.dcivision.setup.web,com.dcivision.staff,com.dcivision.staff.bean,com.dcivision.staff.dao,com.dcivision.staff.web,com.dcivision.upload.core,com.dcivision.upload.web,com.dcivision.user,com.dcivision.user.auth,com.dcivision.user.bean,com.dcivision.user.dao,com.dcivision.user.web,com.dcivision.webdav,com.dcivision.webdav.util,com.dcivision.workflow,com.dcivision.workflow.action,com.dcivision.workflow.applet,com.dcivision.workflow.applet.editor,com.dcivision.workflow.applet.editor.gif,com.dcivision.workflow.bean,com.dcivision.workflow.core,com.dcivision.workflow.dao,com.dcivision.workflow.layout,com.dcivision.workflow.taglib,com.dcivision.workflow.web"<br />             sourcepath="${java.src}"<br />             destdir="${build.javadoc.dir}"<br />             windowtitle="DCIVISION ParaDM API"<br />             author="Yes"<br />             version="Yes"<br />             use="Yes"<br />             maxmemory="512M"<br />             splitindex="Yes"><br />     &lt;classpath refid="build.classpath"/><br />    &lt;/javadoc><br />  &lt;/target><br /><br />  &lt;target name="tlddoc" depends="compile"><br />    &lt;java fork="true" jar="${build.dir}/lib/tlddoc.jar" failonerror="true"><br />      &lt;arg line="-d ${build.tlddoc.dir}"/><br />      &lt;arg value="${build.dir}/calendar.tld"/><br />      &lt;arg value="${build.dir}/cewolf.tld"/><br />      &lt;arg value="${build.dir}/dms.tld"/><br />      &lt;arg value="${build.dir}/layout.tld"/><br />      &lt;arg value="${build.dir}/newCalendar.tld"/><br />      &lt;arg value="${build.dir}/schedule.tld"/><br />      &lt;arg value="${build.dir}/struts-bean.tld"/><br />      &lt;arg value="${build.dir}/struts-html.tld"/><br />      &lt;arg value="${build.dir}/struts-logic.tld"/><br />      &lt;arg value="${build.dir}/struts-nested.tld"/><br />      &lt;arg value="${build.dir}/struts-template.tld"/><br />      &lt;arg value="${build.dir}/struts-tiles.tld"/><br />      &lt;arg value="${build.dir}/workflow.tld"/><br />    &lt;/java><br />  &lt;/target><br /><br />  &lt;target name="jsdoc" description="Document the JavaScript">  <br />    &lt;exec executable="perl"> <br />      &lt;arg value="${build.jsdoc.pl}"/><br />      &lt;arg value="-r" /><br />      &lt;arg value="--package-naming" /><br />      &lt;arg value="--no-lexical-privates" /><br />      &lt;arg value="--project-name" /><br />      &lt;arg value="ParaDM Javascript" /><br />      &lt;arg value="--logo" /><br />      &lt;arg value="${webapp.src}/img/pref3/common/LayoutLogoDefault.gif" /><br />      &lt;arg value="--directory"/><br />      &lt;arg value="${build.jsdoc.dir}"/><br />      &lt;arg file="${webapp.src}/js/AnchorPosition.js"/>  <br />      &lt;arg file="${webapp.src}/js/autoSuggest.js"/>  <br />      &lt;arg file="${webapp.src}/js/ColorPicker.js"/>  <br />      &lt;arg file="${webapp.src}/js/dojo.js"/>  <br />      &lt;arg file="${webapp.src}/js/FloatingSelectionBox.js"/>  <br />      &lt;arg file="${webapp.src}/js/FormFunction.js"/>  <br />      &lt;arg file="${webapp.src}/js/Framework.js"/>  <br />      &lt;arg file="${webapp.src}/js/NewCalendar.js"/>  <br />      &lt;arg file="${webapp.src}/js/OverLib.js"/>  <br />      &lt;arg file="${webapp.src}/js/OverLibHiddenForm.js"/>  <br />      &lt;arg file="${webapp.src}/js/PermissionSetup.js"/>  <br />      &lt;arg file="${webapp.src}/js/PopupCalendar.js"/>  <br />      &lt;arg file="${webapp.src}/js/PopupWindow.js"/>  <br />      &lt;arg file="${webapp.src}/js/Tree.js"/>  <br />      &lt;arg file="${webapp.src}/js/dojo"/>  <br />      &lt;arg file="${webapp.src}/js/dojo/dnd"/>  <br />      &lt;arg file="${webapp.src}/js/dojo/event"/>  <br />      &lt;arg file="${webapp.src}/js/dojo/html"/>  <br />    &lt;/exec>  <br />  &lt;/target>  <br /><br />  &lt;!-- Command for clean up classes files --><br />  &lt;target name="clean"><br />    &lt;echo message="Cleanup ..."/><br />    &lt;antcall target="stop"/><br />    &lt;delete dir="${tomcat.home}/work/Standalone/localhost/${webapp.name}"/><br />    &lt;delete dir="${build.dir}/classes"/><br />    &lt;delete dir="${build.dir}/services"/><br />    &lt;delete><br />      &lt;fileset dir="${build.dir}/lib" includes="paradm-web*.jar"/><br />    &lt;/delete><br />    &lt;delete dir="${webapp.temp.resources}"/><br />    &lt;delete dir="${webapp.temp.classes}"/><br />    &lt;delete dir="${webapp.temp.lib}"/><br />    &lt;delete dir="${webapp.temp.wsapi}"/><br />    &lt;delete dir="${webapp.temp.services}"/><br />    &lt;antcall target="wsapi-clean"/><br />  &lt;/target><br /><br />  &lt;!-- Command for build --><br />  &lt;target name="build" depends="compile_src, compile_res, copy_properties"><br />    &lt;jar jarfile="${build.dir}/lib/paradm-web-${webapp.version}.jar" basedir="${webapp.temp.classes}" excludes="*.properties,log4j.xml,com/dcivision/resource/**"/><br />    &lt;jar jarfile="${build.dir}/lib/paradm-client.jar" basedir="${webapp.temp.classes}" includes="com/dcivision/dms/client/**"/><br />    &lt;move file="${build.dir}/lib/paradm-client.jar" todir="${java.src}/../client/"/><br />    &lt;copy file="${java.src}/dms.conf" todir="${java.src}/../client/"/><br />    &lt;copy file="${java.src}/clientrun.bat" todir="${java.src}/../client/"/><br />    &lt;delete includeemptydirs="true"><br />      &lt;fileset dir="${build.dir}/classes"><br />         &lt;include name="com/**"/><br />         &lt;include name="*.class"/><br />      	 &lt;exclude name="*.xml"/><br />      	 &lt;exclude name="com/dcivision/resource/**"/><br />      &lt;/fileset><br />    &lt;/delete><br />  &lt;/target><br /><br />  &lt;!-- Command for parascan client build --><br />  &lt;target name="client" depends="compile"><br />    &lt;jar jarfile="${build.dir}/lib/paradm-client.jar" basedir="${build.dir}/classes" includes="com/dcivision/dms/client/**"/><br />    &lt;move file="${build.dir}/lib/paradm-client.jar" todir="${java.src}/../client/"/><br />  &lt;/target><br /><br />  &lt;!-- Command for parsing JSP --><br />  &lt;target name="parsejsp" depends="compile"><br />    &lt;echo message="${tomcat.home}"/><br /><br />    &lt;copy todir="${basedir}/../temp"><br />      &lt;fileset dir="${webapp.src}"><br />        &lt;exclude name="**/*.db"/><br />        &lt;exclude name="**/*.txt"/><br />        &lt;exclude name="**/*.gif"/><br />        &lt;exclude name="**/*.class"/><br />        &lt;exclude name="**/*.jpg"/><br />      &lt;/fileset><br />      &lt;mapper type="glob" from="*.jsp" to="*.jsp"/><br />    &lt;/copy><br /><br />    &lt;copy todir="${basedir}/../temp"><br />      &lt;fileset dir="${webapp.src}"><br />        &lt;exclude name="**/*.db"/><br />        &lt;exclude name="**/*.txt"/><br />        &lt;exclude name="**/*.gif"/><br />        &lt;exclude name="**/*.jpg"/><br />        &lt;exclude name="**/*.jsp"/><br />      &lt;/fileset><br />    &lt;/copy><br /><br />    &lt;mkdir dir="${tomcat.home}/work/Standalone/localhost/${webapp.name}"/><br /><br />    &lt;jspc srcdir="${basedir}/../temp" destdir="${tomcat.home}/work/Standalone/localhost/${webapp.name}" uriroot="${basedir}/../temp" failonerror="No"><br />       &lt;classpath refid="build.classpath"/><br />       &lt;include name="**/*.jsp"/><br />       &lt;webapp basedir="${basedir}/../temp"/><br />    &lt;/jspc><br /><br />    &lt;replaceregexp byline="true"><br />      &lt;regexp pattern="package (.*)" /><br />      &lt;substitution expression="package org.apache.jsp;" /><br />      &lt;fileset dir="${tomcat.home}/work/Standalone/localhost/${webapp.name}"><br />        &lt;include name="**/*.java" /><br />      &lt;/fileset><br />    &lt;/replaceregexp><br /><br />    &lt;deltree dir="${basedir}/../temp"/><br />  &lt;/target><br /><br />  &lt;!-- Command for compiling JSP --><br />  &lt;target name="jspc"><br />    &lt;taskdef classname="org.apache.jasper.JspC" name="jasper2" ><br />      &lt;classpath id="jspc.classpath"><br />        &lt;pathelement location="${java.home}/../lib/tools.jar"/><br />        &lt;fileset dir="${tomcat.home}/server/lib"><br />          &lt;include name="*.jar"/><br />        &lt;/fileset><br />        &lt;fileset dir="${tomcat.home}/common/lib"><br />          &lt;include name="*.jar"/><br />        &lt;/fileset><br />      &lt;/classpath><br />    &lt;/taskdef><br /><br />    &lt;taskdef name="foreach"<br />        classname="net.sf.antcontrib.logic.ForEach"<br />        classpath="${ant}/ant-contrib.jar" /><br /><br />    &lt;jasper2<br />       validateXml="false"<br />       uriroot="${webapp.src}"<br />       webXmlFragment="${webapp.src}/WEB-INF/generated_web.xml"<br />       outputDir="${webapp.src}/WEB-INF/src"<br />       package="some.unique.string.asd34sad"><br />    &lt;/jasper2><br /><br />    &lt;replaceregexp match="^package some.unique.string.asd34sad.*;"<br />             replace="package org.apache.jsp;"<br />             byline="true"><br />      &lt;fileset dir="${webapp.src}/WEB-INF/src"><br />        &lt;include name="**/*.*"/><br />      &lt;/fileset><br />    &lt;/replaceregexp><br /><br />    &lt;echo>Compiling generated classes from JSPC&lt;/echo><br />    &lt;foreach target="do-jsp-compile" param="dir-path"><br />      &lt;path><br />        &lt;dirset dir="${webapp.src}/WEB-INF/src"/><br />      &lt;/path><br />    &lt;/foreach><br />    &lt;move todir="${tomcat.home}/work/Standalone/localhost/${webapp.name}"><br />      &lt;fileset dir="${webapp.src}/WEB-INF/src"><br />        &lt;include name="**/*.*"/><br />      &lt;/fileset><br />    &lt;/move><br />    &lt;delete dir="${webapp.src}/WEB-INF/src"/><br />  &lt;/target><br /><br />  &lt;target name="do-jsp-compile"><br />    &lt;echo>Compile JSP in: ${dir-path}&lt;/echo><br />    &lt;javac destdir="${dir-path}"<br />         optimize="off"<br />         debug="on"<br />         failonerror="false"<br />         srcdir="${dir-path}"><br />      &lt;classpath><br />        &lt;pathelement location="${webapp.src}/WEB-INF/classes"/><br />        &lt;fileset dir="${webapp.src}/WEB-INF/lib"><br />          &lt;include name="*.jar"/><br />        &lt;/fileset><br />        &lt;pathelement location="${tomcat.home}/common/classes"/><br />        &lt;fileset dir="${tomcat.home}/common/lib"><br />          &lt;include name="*.jar"/><br />        &lt;/fileset><br />        &lt;pathelement location="${tomcat.home}/shared/classes"/><br />        &lt;fileset dir="${tomcat.home}/shared/lib"><br />          &lt;include name="*.jar"/><br />        &lt;/fileset><br />      &lt;/classpath><br />      &lt;include name="*.java" /><br />    &lt;/javac><br />    &lt;mkdir dir="${dir-path}/org/apache/jsp"/><br />    &lt;move todir="${dir-path}" failonerror="false"><br />      &lt;fileset dir="${dir-path}/org/apache/jsp"><br />        &lt;include name="*.*"/><br />      &lt;/fileset><br />    &lt;/move><br />    &lt;delete dir="${dir-path}/org" failonerror="false"/><br />  &lt;/target><br />  <br />  &lt;!--<br />    Task to initialize mysql connection settings<br />  --><br />  &lt;target name="db_init_mysql"><br />  &lt;/target>  <br />  <br />  &lt;!-- <br />    Task to mysql deployment, it can:    	<br />      1) checkout the latest source from db/mysql folder<br />    	2) create a new database instance<br />    	3) deploy default ParaDM configuration data<br />    	4) create a databaes user (paradm) for ParaDM application access<br />    	5) grant privileges to this database user (paradm)<br />    	6) update the ParaDM system parameter and storage location path for ParaDOC (DMS_LOC_MASTER.LOC_PATH)<br />    	<br />    You need to fill in the correct parameters to make it works:<br />    	${database.location}      : Location of your database, default is "localhost"<br />    	${database.dba.login}     : Database administrator login, default is "root"<br />    	${database.dba.password}  : Database administrator password<br />    	${database.user.login}    : Database user login, default is "paradm"<br />    	${database.user.password} : Database user password, default is "paradm"<br />    	${database.sid}           : Database instance you want to create, default is "ParaDM"<br />  -->  <br />  &lt;target name="db_deploy_mysql" depends="db_cvsupdate_mysql"><br />    &lt;property name="database.driver" value="com.mysql.jdbc.Driver"/><br />    &lt;property name="database.url" value="jdbc:mysql://${database.location}:3306/mysql?useUnicode=true&amp;characterEncoding=UTF-8&amp;autoReconnect=true"/>          <br />    &lt;sql<br />      driver="${database.driver}"<br />      url="${database.url}"<br />      userid="${database.dba.login}"<br />      password="${database.dba.password}" <br />      onerror="continue"><br />      &lt;classpath refid="build.classpath"/><br />      &lt;transaction><br />        CREATE DATABASE ${database.sid};<br />        USE ${database.sid};<br />        GRANT ALL PRIVILEGES ON ${database.sid}.* TO '${database.user.login}'@'${database.location}' IDENTIFIED BY '${database.user.password}'        <br />      &lt;/transaction>      <br />      &lt;transaction  src="../db/mysql/structure.sql"/><br />      &lt;transaction  src="../db/mysql/data.sql"/><br />    &lt;/sql><br />    &lt;antcall target="db_configure" inheritAll="true"/><br />  &lt;/target>  <br />  <br />  &lt;!-- <br />    Task to auto apply db patch to your database  <br />    Comment out the db_cvsupdate_mysql task if you don't want to update source before apply the db patch.<br />  --><br />  &lt;target name="db_patch_mysql"  depends="db_cvsupdate_mysql"><br />    &lt;property name="database.driver" value="com.mysql.jdbc.Driver"/><br />    &lt;property name="database.url" value="jdbc:mysql://${database.location}:3306/${database.sid}?useUnicode=true&amp;characterEncoding=UTF-8&amp;autoReconnect=true"/>          <br />    &lt;property name="database.type" value="mysql"/>          <br />    <br />    &lt;antcall target="db_patch" inheritAll="true"/><br />  &lt;/target>       <br />  <br />  &lt;!-- <br />    Task called by db_patch_{database_type} to apply SQL patch     <br />  -->  <br />  &lt;target name="db_patch"><br />    &lt;sql<br />      driver="${database.driver}"<br />      url="${database.url}"<br />      userid="${database.user.login}"<br />      password="${database.user.password}" <br />      onerror="continue"><br />      &lt;classpath refid="build.classpath"/><br />      &lt;transaction  src="../db/${database.type}/alter3.2.0.sql"/><br />    &lt;/sql><br />  &lt;/target>   <br />  <br />  &lt;!-- <br />    Task called by db_deploy_{database_type} to update ParaDM system parameters and ParaDOC root location path<br />  -->    <br />  &lt;target name="db_configure"><br />    &lt;sql<br />      driver="${database.driver}"<br />      url="${database.url}"<br />      userid="${database.dba.login}"<br />      password="${database.dba.password}" <br />      onerror="continue"><br />      &lt;classpath refid="build.classpath"/><br /><br />      &lt;transaction>        <br />        UPDATE ${database.sid}.DMS_LOC_MASTER SET LOC_PATH='${paradm.home.file}/ParaDOC';        <br />        <br />        UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaDOC'        WHERE PARAMETER_CODE='dms.archive_file_path';<br />        UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaDOC/cache/' WHERE PARAMETER_CODE='dms.emailArchive.cachefolder.path';<br />        UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaFORM'       WHERE PARAMETER_CODE='form.attachment_physical_path';<br />        UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/KB'             WHERE PARAMETER_CODE='rules.kb_file_path';<br />        UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/Index'          WHERE PARAMETER_CODE='system.index_base_path';<br />        UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaFLOW'       WHERE PARAMETER_CODE='workflow.attachment_physical_path';<br />        UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaFlow/AutomaticTask/bin' WHERE PARAMETER_CODE='workflow.automatic_task_bindir';<br />        UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaFlow/AutomaticTask/src' WHERE PARAMETER_CODE='workflow.automatic_task_srcdir';<br />      &lt;/transaction> <br />    &lt;/sql><br />  &lt;/target>    <br />  <br />  &lt;!-- Task to update the CVS MySQL db script folder  --><br />  &lt;target name="db_cvsupdate_mysql"><br />    &lt;cvs dest="../db/mysql/" command="update"/><br />  &lt;/target>   <br /><br />  &lt;target name="restart"><br />    &lt;antcall target="stop"/><br />    &lt;delete dir="${tomcat.home}/work/Standalone/localhost/${webapp.name}"/><br />    &lt;antcall target="start"/><br />  &lt;/target><br /><br />  &lt;target name="stop"><br />    &lt;exec executable="cmd.exe" os="Windows XP"><br />      &lt;arg line="/c net stop &quot;${tomcat.service}&quot;"/><br />    &lt;/exec><br />  &lt;/target><br /><br />  &lt;target name="start"><br />    &lt;exec executable="cmd.exe" os="Windows XP"><br />      &lt;arg line="/c net start &quot;${tomcat.service}&quot;"/><br />    &lt;/exec><br />  &lt;/target><br /><br />  &lt;target name="war" depends="build"><br />    &lt;war destfile="${webapp.temp.war}/${webapp.name}-${timestamp}.war" webxml="D:\Projects\${webapp.name}\Source\web\WEB-INF\web.xml"><br />      &lt;fileset dir="D:\Projects\${webapp.name}\Source\web"><br />        &lt;exclude name="**/*.rar"/><br />        &lt;exclude name="**/*.zip"/><br />        &lt;exclude name="**/.#*"/><br />        &lt;exclude name="temp/**"/><br />        &lt;exclude name="viewer/**"/><br />        &lt;exclude name="WEB-INF/web.xml"/><br />        &lt;exclude name="WEB-INF/classes/**"/><br />        &lt;exclude name="WEB-INF/lib/**"/><br />      &lt;/fileset><br />      &lt;lib dir="D:\Projects\${webapp.name}\Source\web\WEB-INF\lib"> <br />        &lt;exclude name="ant.jar"/><br />      &lt;/lib> <br />      &lt;classes dir="D:\Projects\${webapp.name}\Source\web\WEB-INF\classes"/> <br />    &lt;/war> <br />  &lt;/target><br /><br />  &lt;target name="wsapi-clean"><br />&lt;!--    &lt;delete dir="${wsapi.dir}"/>--><br />  &lt;/target><br /><br />  &lt;target name="wsapi"><br />    &lt;antcall target="wsapi-clean"/><br />    &lt;mkdir dir="${wsapi.dir}"/><br />    &lt;foreach target="wsapi-module" param="wsapi.module.dir" inheritall="true"><br />      &lt;path><br />        &lt;dirset dir="${java.src}/com/dcivision/resource/services"><br />          &lt;include name="*"/><br />          &lt;exclude name="schemas"/><br />        &lt;/dirset><br />      &lt;/path><br />    &lt;/foreach><br />    &lt;mkdir dir="${wsapi.lib}"/><br />    &lt;jar jarfile="${wsapi.lib}/paradm-ws-api.jar" basedir="${wsapi.classes}"/><br />  &lt;/target><br /><br />  &lt;target name="wsapi-module" depends="wsapi.chkUpToDate" unless="wsapi.notRequired"><br />    &lt;foreach target="wsapi-service" param="wsapi.service.wsdl" inheritall="true"><br />      &lt;path><br />        &lt;fileset dir="${java.src}/com/dcivision/resource/services/${wsapi.module.name}"><br />          &lt;include name="*.wsdl"/><br />        &lt;/fileset><br />      &lt;/path><br />    &lt;/foreach><br />    &lt;mkdir dir="${wsapi.classes}"/><br />    &lt;copy todir="${wsapi.classes}/schemaorg_apache_xmlbeans"><br />      &lt;fileset dir="${wsapi.dir}/resources/schemaorg_apache_xmlbeans"/><br />    &lt;/copy><br />    &lt;javac srcdir="${wsapi.dir}/src" destdir="${wsapi.classes}" debug="on" memoryInitialSize="128m" memoryMaximumSize="256m" fork="true"><br />      &lt;classpath refid="build.classpath"/><br />    &lt;/javac><br />  &lt;/target><br /><br />  &lt;target name="wsapi.chkUpToDate"><br />    &lt;basename property="wsapi.module.name" file="${wsapi.module.dir}"/><br />    &lt;echo message="Checking WS-${wsapi.module.name} for update"/><br />    &lt;uptodate property="wsapi.notRequired" targetfile="${wsapi.lib}/paradm-ws-api.jar" ><br />      &lt;srcfiles dir= "${java.src}/com/dcivision/resource/services"><br />        &lt;include name="schemas/*.xsd"/><br />        &lt;include name="${wsaar.module.name}/*.wsdl"/><br />        &lt;include name="${wsaar.module.name}/*.xsd"/><br />        &lt;!-- No need to generate the API even services.xml is modified --><br />        &lt;exclude name="${wsaar.module.name}/services.xml"/><br />      &lt;/srcfiles><br />    &lt;/uptodate><br />    &lt;if><br />      &lt;istrue value="${wsapi.notRequired}"/><br />      &lt;then>&lt;echo message="Web Service ${wsapi.module.name} up to date: ${wsapi.notRequired}"/>&lt;/then><br />    &lt;/if><br />  &lt;/target><br /><br />  &lt;target name="wsapi-service"><br />    &lt;basename property="wsapi.service.name" file="${wsapi.service.wsdl}" suffix=".wsdl"/><br />    &lt;echo message="    Parsing ${wsapi.service.name}"/><br />    &lt;antcall target="wsdl2java" inheritAll="true"/><br />    &lt;move file="${wsapi.dir}/resources/services.xml" tofile="${wsapi.dir}/services/${wsapi.module.name}/${wsapi.service.name}-service.xml" /><br />    &lt;move todir="${wsapi.dir}/services/${wsapi.module.name}"><br />      &lt;fileset dir="${wsapi.dir}/resources"><br />        &lt;include name="*.wsdl"/><br />        &lt;include name="*.xsd"/><br />      &lt;/fileset><br />    &lt;/move><br />  &lt;/target><br /><br />  &lt;target name="wsdl2java"><br />    &lt;taskdef name="codegen" classname="org.apache.axis2.tool.ant.AntCodegenTask"  classpathref="build.classpath"/><br />    &lt;echo message="${java.src}/com/dcivision/resource/services/${wsapi.module.name}/${wsapi.service.name}.wsdl"/><br />    &lt;codegen <br />      wsdlVersion="1.1"<br />      wsdlfilename="${java.src}/com/dcivision/resource/services/${wsapi.module.name}/${wsapi.service.name}.wsdl"<br />      serviceName="${wsapi.service.name}"<br />      portName="${wsapi.service.name}SOAP12Port"<br />      databindingName="xmlbeans"<br />      generateAllClasses="true" <br />      serverSide="true"<br />      serverSideInterface="true"<br />      generateServiceXml="true"<br />      output="${wsapi.dir}" <br />      /><br />  &lt;/target><br /><br />  &lt;target name="wsdl2java2"><br />    &lt;java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true"><br />      &lt;classpath refid="build.classpath"/><br />      &lt;arg value="-uri"/><br />      &lt;arg file="${java.src}/com/dcivision/resource/services/${wsapi.module.name}/${wsapi.service.name}.wsdl"/><br />      &lt;arg value="-d"/><br />      &lt;arg value="none"/><br />      &lt;arg value="-ss"/><br />      &lt;arg value="-g"/><br />      &lt;arg value="-sd"/><br />      &lt;arg value="-o"/><br />      &lt;arg file="${wsapi.dir}"/><br />    &lt;/java><br />  &lt;/target><br /><br />  &lt;target name="wsaar"><br />    &lt;copy todir="${build.dir}/services/lib" file="${wsapi.lib}/paradm-ws-api.jar"/><br />    &lt;foreach target="wsaar-module" param="wsaar.module.dir" inheritall="true"><br />      &lt;path><br />        &lt;dirset dir="${java.src}/com/dcivision/resource/services"><br />          &lt;include name="*"/><br />          &lt;exclude name="schemas"/><br />        &lt;/dirset><br />      &lt;/path><br />    &lt;/foreach><br />  &lt;/target><br /><br />  &lt;target name="wsaar-module" depends="wsaar.chkUpToDate" unless="wsaar.notRequired"><br />    &lt;property name="services.xml.dir" value="${webapp.temp.services}/WS-${wsaar.module.name}/META-INF"/><br />    &lt;antcall target="services.xml" inheritAll="true"/><br />    &lt;copy todir="${webapp.temp.services}/WS-${wsaar.module.name}/META-INF"><br />      &lt;fileset dir="${java.src}/com/dcivision/resource/services/${wsaar.module.name}"><br />        &lt;include name="*.wsdl"/><br />        &lt;include name="*.xsd"/><br />        &lt;include name="*.xml"/><br />      &lt;/fileset><br />    &lt;/copy><br />    &lt;copy todir="${webapp.temp.services}/WS-${wsaar.module.name}/schemas"><br />      &lt;fileset dir="${java.src}/com/dcivision/resource/services/schemas"><br />        &lt;include name="*.xsd"/><br />      &lt;/fileset><br />    &lt;/copy><br />    &lt;mkdir dir="${webapp.temp.services}/WS-${wsaar.module.name}/lib"/><br />    &lt;jar jarfile="${webapp.temp.services}/WS-${wsaar.module.name}/lib/WS-${wsaar.module.name}-impl.jar" basedir="${webapp.temp.classes}" includes="com/dcivision/ws/**"/><br />    &lt;jar jarfile="${webapp.temp.services}/WS-${wsaar.module.name}.aar" basedir="${webapp.temp.services}/WS-${wsaar.module.name}"/><br />    &lt;mkdir dir="${build.dir}/services"/><br />    &lt;copy todir="${build.dir}/services/" file="${webapp.temp.services}/WS-${wsaar.module.name}.aar"/><br />  &lt;/target><br /><br />  &lt;target name="wsaar.chkUpToDate"><br />    &lt;basename property="wsaar.module.name" file="${wsaar.module.dir}"/><br />    &lt;echo message="Checking WS-${wsaar.module.name} for update"/><br />    &lt;uptodate property="wsaar.notRequired" targetfile="${webapp.temp.services}/WS-${wsaar.module.name}.aar" ><br />      &lt;srcfiles dir= "${java.src}/com/dcivision/resource/services"><br />        &lt;include name="schemas/*.xsd"/><br />        &lt;include name="${wsaar.module.name}/*.wsdl"/><br />        &lt;include name="${wsaar.module.name}/*.xsd"/><br />        &lt;!-- If services.xml is modified, need to generate a new .aar file --><br />        &lt;include name="${wsaar.module.name}/services.xml"/><br />      &lt;/srcfiles><br />    &lt;/uptodate><br />    &lt;if><br />      &lt;istrue value="${wsaar.notRequired}"/><br />      &lt;then>&lt;echo message="Web Service ${wsaar.module.name} up to date: ${wsaar.notRequired}"/>&lt;/then><br />    &lt;/if><br />    <br />  &lt;/target><br /><br />  &lt;!-- ========================================================================= --><br />  &lt;!-- TODO: Dynamically merge each generated services.xml into one within the same module                             --><br />  &lt;!-- ========================================================================= --><br />  &lt;target name="services.xml"><br />  &lt;/target><br /><br />&lt;/project>
          <br/>
          <span style="color:red;">
            <a href="http://huaqingfly.javaeye.com/blog/66698#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Fri, 30 Mar 2007 16:37:44 +0800</pubDate>
        <link>http://huaqingfly.javaeye.com/blog/66698</link>
        <guid>http://huaqingfly.javaeye.com/blog/66698</guid>
      </item>
  </channel>
</rss>