用myeclipse进行开发的时候,每一次类有些许修改就要点击重新部署的按钮,好像用ant是可以实现这个功能。那是不是用ant只把修改了的那个类进行重新编译呢?
解决方案 »
- spring DATA JPA 带条件分页查询的问题
- Struts2 禁止重复登录的问题,谢谢。
- JSP中不使用AJAX如何实现下拉框联动
- jsp 语法问题
- 看了几天的Spring,还很晕,根本如不了门,熟悉Spring的朋友能给点指点吗?
- Spring注入失败,涉及到继承时
- 请教各位:关于EJB调用的问题
- 哪儿可以找到可用于SQL SERVER的专业级的数据库连接池 50分相送!
- 用j2sdkee1.3.1 j2ee -verbose出了下面的错,请各位帮我诊断一下
- ejb在JB5中调试成功以后,怎样配置服务器,使客户机能够访问???敬请帮忙,一定加分!
- 运行Maven的命令mvn活着建立maven项目出现错误
- createSQLQuery()的addEntity()问题
给你玩玩吧。<?xml version="1.0" encoding="UTF-8"?>
<project name="project-name" basedir="." default="usage">
<property file="build.properties" />
<property name="src.dir" value="src" />
<property name="build.dir" value="./${WEB_DIR}/WEB-INF/classes" />
<property name="project.dir" value="." />
<path id="master-classpath">
<fileset dir="${WEB_DIR}/WEB-INF/lib">
<include name="*.jar" />
</fileset>
<fileset dir="${TOMCAT_HOME}/lib">
<include name="servlet*.jar" />
</fileset>
<pathelement path="${build.dir}" />
</path>
<target name="usage">
<echo message="TARGET LIST by yingzhuo" />
<echo message="---------------------------------------------------------------" />
<echo message="usage --> Show this list" />
<echo message="build --> Build the application" />
<echo message="rebuild --> Rebuild the application" />
<echo message="clear --> Delete all class files" />
<echo message="doc --> Generates code documentation using the javadoc tool" />
<echo message="zip --> Create zip file that reference project directory" />
<echo message="deploy --> Deploy this project" />
<echo message="deploy-war --> Deploy this project by WAR file" />
<echo message="undeploy --> Remove deployment files" />
<echo message="---------------------------------------------------------------" />
<echo message="" />
</target>
<target name="build">
<mkdir dir="${build.dir}" />
<javac destdir="${build.dir}" source="1.6" target="1.6" debug="true" deprecation="false" optimize="false" failonerror="true">
<src path="${src.dir}" />
<classpath refid="master-classpath" />
</javac>
<copy todir="${build.dir}" preservelastmodified="true">
<fileset dir="${src.dir}">
<include name="**/*.properties" />
<include name="**/*.handlers" />
<include name="**/*.schemas" />
<include name="**/*.xml" />
<include name="**/*.dtd" />
<include name="**/*.xsd" />
<include name="**/*.vm" />
<include name="**/*.ftl" />
<include name="**/*.types" />
</fileset>
</copy>
</target>
<target name="rebuild" depends="clear,build" />
<target name="clear">
<delete dir="${build.dir}" />
<mkdir dir="${build.dir}" />
</target>
<target name="doc">
<javadoc sourcepath="${src.dir}" destdir="docs" docencoding="UTF-8" charset="UTF-8">
</javadoc>
</target>
<target name="zip">
<delete file="${ZIP_DEST}/${PROJECT_NAME}.zip" />
<zip destfile="${ZIP_DEST}/${PROJECT_NAME}.zip" basedir="${project.dir}" level="9" />
</target>
<target name="deploy" depends="build">
<copy todir="${DEPLOY_PATH}/${APPLICATION_NAME}" preservelastmodified="true">
<fileset dir="${WEB_DIR}">
<include name="**/*.*" />
</fileset>
</copy>
</target>
<target name="deploy-war" depends="build">
<war destfile="${APPLICATION_NAME}.war" webxml="${WEB_DIR}/WEB-INF/web.xml">
<fileset dir="${WEB_DIR}">
<include name="**/*.*" />
</fileset>
</war>
<copy todir="${DEPLOY_PATH}" preservelastmodified="true">
<fileset dir=".">
<include name="*.war" />
</fileset>
</copy>
<delete file="${APPLICATION_NAME}.war"/>
</target>
<target name="undeploy">
<delete file="${DEPLOY_PATH}/${APPLICATION_NAME}.war"/>
<delete dir="${DEPLOY_PATH}/${APPLICATION_NAME}"/>
</target>
</project>
参数文件 build.properties# project name
PROJECT_NAME=ant-practice2# zip file destination dir
ZIP_DEST=C:/Users/DellYing/Desktop# web root
WEB_DIR=WebRoot#============================================
# Tomcate Settings
#============================================
TOMCAT_HOME=D:/DevTools/apache-tomcat-6.0.16
DEPLOY_PATH=${TOMCAT_HOME}/webapps
APPLICATION_NAME=${PROJECT_NAME}
听说用的多,不过我只用过一点 ant