标签:
<project basedir="." default="build" name="othersysm"> </project>
<target depends="build-project" name="build"/>
<property name="ibslib.location" value="../ibslib"/><property name="debuglevel" value="source,lines,vars"/><property name="target" value="6"/><property name="source" value="6"/>
3、定义jar包路径,并命名,fileset表示引用外部包,pathelement表示内部
<path id="othersysm.classpath"> <pathelement path="{classpath}"/> <fileset dir="${ibslib.location}/lib/logging" includes="**/*.jar,**/*.zip"/> <pathelement location="bin"/> </classpath>
<target name="init">
<echo> +=======================================+ | init +=======================================+ </echo>
<mkdir dir="test"/>
<copy includeemptydirs="false" todir="test"><!--忽略空文件夹,并且拷贝到指定目录-->
<fileset dir="src" excludes="**/*.launch, **/*.java"/><!--忽略指定文件-->
</copy>
</target>
5、编译java文件,编译命令为:
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/><!-- 打印ant脚本目录 -->
<javac debug="true" debuglevel="${debuglevel}" destdir="test" source="${source}" target="${target}" encoding="UTF-8" includeantruntime="false">
<src path="src"/><!-- 源文件目录 -->
<classpath refid="othersysm.classpath"/><!-- classpath目录 -->
</javac>
</target>
<ant antfile="${web.location}/build.xml" inheritAll="false" target="genwar" output="output.log"><property name="currentMode" value="${currentMode}"/><property name="targetMode" value="${targetMode}"/></ant>
<property file="${basedir}/build.properties"/>
<replaceregexp byline="true"> <regexp pattern="正则表达式"/> <substitution expression="将要替换的值"/> <fileset dir="${unpack.war.dir}/WEB-INF" includes="web.xml"/> </replaceregexp>
<war destfile="${uibs.location}/web.war" webxml="WebContent/WEB-INF/web.xml"><fileset dir="WebContent" includes="**"/></war>
10、通过scp命令将上传war包文件到指定机器的指定目录
<scp file="${uibs.location}/${server.name}.war" todir="${wls.username}:${wls.password}@${remote.host}:${deploy.location}" trust="true"/>
11、远程ssh,执行服务器命令,执行启动脚本
<sshexec host="${remote.host}" username="${remote.username}" password="${remote.password}" command="ls" trust="true"/>
标签:
原文地址:http://www.cnblogs.com/jyyzzjl/p/4888745.html