<?xml version="1.0" encoding="UTF-8"?> <project name="examination" basedir="."> <property name="src.dir" location="src"/> <property name="webapp" location="WebContent"/> <property name="lib.dir" location="WebContent/WEB-INF/lib"/> <property name="build.dir" location="WebContent/WEB-INF/classes"/> <property name="tomcat.home" value="D:/apache/apache-tomcat-6.0.29" /> <property name="jrebel.path" value="d:/apache/jrebel.jar" /> <path id="project.classpath"> <fileset dir="${lib.dir}"> <include name="**/*.jar" /> </fileset> </path> <patternset id="meta.files"> <include name="**/*.xml" /> <include name="**/*.properties" /> </patternset> <target name="init_knowledge"> <java classpathref="project.classpath" classname="com.genrong.chem.test.KnowledgInitTest"> </java> </target> <target name="compile"> <javac srcdir="${src.dir}" destdir="${build.dir}" nowarn="on"> <classpath refid="project.classpath" /> </javac> </target> <target name="clean"> <copy todir="${build.dir}" overwrite="true"> <fileset dir="${src.dir}"> <patternset refid="meta.files" /> </fileset> </copy> </target> <target name="db_init"> <sql driver="com.mysql.jdbc.Driver" url="jdbc:mysql://127.0.0.1/chem" userid="root" password="root" classpathref="project.classpath"> <transaction src="WebContent/WEB-INF/db/init.sql" mce_src="WebContent/WEB-INF/db/init.sql"/> </sql> </target> <target name="db_restore"> <exec executable="mysql" input="WebContent/WEB-INF/db/dump.sql"> <arg value="--user=root" /> <arg value="--password=root" /> <arg value="--host=localhost" /> <arg value="--port=3306" /> <arg value="chem" /> </exec> </target> <target name="db_dump"> <exec executable="mysqldump" output="WebContent/WEB-INF/db/dump.sql"> <arg value="--user=root" /> <arg value="--password=root" /> <arg value="--host=localhost" /> <arg value="--port=3306" /> <arg value="chem" /> </exec> </target> <target name="run.in.tomcat"> <java classname="com.genrong.chem.Tool4Tomcat" fork="true"> <classpath path="${build.dir}"/> <classpath refid="project.classpath"/> <arg value="tomcat.home=${tomcat.home}"/> <arg value="context=${ant.project.name}"/> <arg value="docBase=${basedir}/WebRoot"/> <arg value="delete=false"/> </java> </target> <target name="run.in.tomcat2"> <property name="context.xml" location="${tomcat.home}/conf/Catalina/localhost/${ant.project.name}.xml"/> <echoxml file="${context.xml}"> <Context path="/${ant.project.name}" docBase="${webapp}" crossContext="true" reloadable="false"/> </echoxml> </target> <!-- - - - - - - - - - - - - - - - - - target: start tomcat - - - - - - - - - - - - - - - - - --> <target name="start.tomcat"> <java jar="${tomcat.home}/bin/bootstrap.jar" fork="true"> <jvmarg value="-Dcatalina.home=${tomcat.home}" /> </java> </target> <!-- - - - - - - - - - - - - - - - - - target: stop tomcat - - - - - - - - - - - - - - - - - --> <target name="stop.tomcat"> <java jar="${tomcat.home}/bin/bootstrap.jar" fork="true"> <jvmarg value="-Dcatalina.home=${tomcat.home}" /> <arg line="stop" /> </java> </target> <!-- - - - - - - - - - - - - - - - - - target: debug tomcat - - - - - - - - - - - - - - - - - --> <target name="debug.tomcat"> <java jar="${tomcat.home}/bin/bootstrap.jar" fork="true"> <jvmarg value="-Dcatalina.home=${tomcat.home}" /> <jvmarg value="-noverify" /> <jvmarg value="-javaagent:${jrebel.path}" /> <jvmarg value="-Xdebug" /> <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" /> </java> </target> <target name="war" depends="compile"> <war encoding="gbk" destfile="examination.war" webxml="WebContent/WEB-INF/web.xml"> <fileset dir="WebContent"> <include name="**/*.*"/> </fileset> </war> </target> </project>