mardi 10 mars 2015

Ant exclude does not exclude directory



I want to package some specific libraries into a package. Therefore, i want to below ant task:



<property name="src" location="src"/>
<property name="build" location="bin"/>
<property name="target" location="c:\\temp\\invoke.jar"/>
<target name="dist" depends="compile"
description="generate the distribution" >
<echo message="Start jar java.lang.invoke package.."/>
<delete file="${target}" />
<jar destfile="${target}" basedir="${build}">
<fileset dir="${build}/">
<include name="java/lang/invoke/*.*" />
<exclude name="com/** javax/** org/** sun/**" />
</fileset>
</jar>
</target>


The directory structure is



c:\....\J9 JCL>dir bin
Directory of C:\...\J9 JCL\bin

03/10/2015 05:42 PM <DIR> com
03/10/2015 05:42 PM <DIR> java
03/10/2015 05:42 PM <DIR> javax
07/20/2014 06:44 PM 2,173 notices.txt
03/10/2015 05:42 PM <DIR> org
07/20/2014 06:44 PM 1,056 rcm.xsd
03/10/2015 05:42 PM <DIR> sun
07/20/2014 06:44 PM 230 tags.properties


AS shown in the "dist" task, only the library in



bin/java/lang/invoke



is required for jar task. But after running, it seems both include and exclude does not work. Is there any wrong with my script?




Aucun commentaire:

Enregistrer un commentaire