3
votes

When I build my .war file via ant, it is excluding a file that doesn't have an extension from the class path. So in the class path there are two specific files WEB-INF/classes/fruit/apple.ppk and then WEB-INF/classes/fruit/apple_dsa, my ant builds the .ppk into the war, but excludes the file with no extension for some reason, how can I avoid this? Here is my ant build for the war file

<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>
2

2 Answers

3
votes

Found an awnser, it was a lot easier than I though:

http://bobcat.webappcabaret.net/javachina/faq/ant_01.htm#ant_mid_Q080

If files are in the directory:

<include name="a,b,c"/>

If files are in the directory or subdirectories:

<include name="**/a,**/b,**/c"/>

If you want all files without extension are in the directory or subdirectories:

<exclude name="**/*.*"/> 
1
votes

Have you tried adding

<include name ="*"/> 
<exclude name="*.*"/>