[英]Using Ant To Build War As a Folder
我正在使用ant構建我的戰爭來部署它。 但是螞蟻將戰爭建立為“webapp.war”文件。 我需要將其構建為“webapp.war”文件夾,我該如何使用ant?
<target name="war" depends="compile">
<war destfile="dist/AntExample.war"
webxml="WebContent/WEB-INF/web.xml" keepcompression="false">
<fileset dir="WebContent"/>
<lib dir="WebContent/WEB-INF/lib"/>
<classes dir="build/classes"/>
</war>
</target>
試試這個......對我有用
<target name="war" depends="compile">
<war destfile="dist/deployme_temp.war" webxml="web/WEB-INF/web.xml">
<fileset dir="web"/>
<lib dir="web/WEB-INF/lib"/>
<classes dir="build/classes"/>
</war>
</target>
<target name="unzip" depends="war">
<unzip src="dist/deployme_temp.war" dest="dist/deployme.war" />
</target>
<target name="copy-war" depends="unzip">
<copy todir="${deploy.destination}/deployme.war" overwrite="true">
<fileset dir="dist/deployme.war"/>
</copy>
</target>
嘗試復制任務 (假設您使用的是Eclipse Dynamic Web Project布局):
<property name="dist" location="webapp.war"/>
<target name="war folder" depends="compile" description="generate the distribution" >
<mkdir dir="${dist}/WEB-INF/classes"/>
<copy todir="${dist}">
<fileset dir="WebContent"/>
</copy>
<copy todir="${dist}/WEB-INF/classes">
<fileset dir="yourClassDir"/>
</copy>
<!-- other stuff to copy-->
</target>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.