[英]How to include maven dependency libraries in war file using Ant build
[英]Include file with no extension in my ant build for my war file
當我通過ant構建我的.war文件時,它排除了一個沒有類路徑擴展名的文件。 所以在類路徑中有兩個特定的文件WEB-INF / classes / fruit / apple.ppk然后是WEB-INF / classes / fruit / apple_dsa,我的ant將.ppk構建成war,但排除了沒有擴展名的文件出於某種原因,我該如何避免這種情況? 這是我對war文件的ant構建
<target name="create-war"
depends="initialize, compile, create-manifest"
description="Creates an WAR file">
<war destfile="${dist.dir}/${war.name}"
webxml="${web.root}/WEB-INF/web.xml"
manifest="${build.dir}/META-INF/MANIFEST.MF"
duplicate="fail">
<classes dir="${java.classes.dir}">
<exclude name="**/*test*" />
</classes>
<fileset dir="${web.root}">
<exclude name="**/*test*" />
<exclude name="WEB-INF/classes/**" />
<exclude name="WEB-INF/web.xml" />
<exclude name="**/context.xml" />
</fileset>
</war>
</target>
找到一個awnser,它比我容易多了:
http://bobcat.webappcabaret.net/javachina/faq/ant_01.htm#ant_mid_Q080
如果文件在目錄中:
<include name="a,b,c"/>
如果文件位於目錄或子目錄中:
<include name="**/a,**/b,**/c"/>
如果您希望所有沒有擴展名的文件都在目錄或子目錄中:
<exclude name="**/*.*"/>
你試過添加嗎?
<include name ="*"/>
<exclude name="*.*"/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.