Java – ant task: using exclusion parameters
Get the following build XML string:
<jar destfile="${lib.dir}/rpt.jar" basedir="${classes.src}" excludes="**/*.java" />
I'm new to ant. I don't understand how to exclude strings Which files are affected? All Java source files?
thank you.
Solution
The first is about the declaration
<jar destfile="${lib.dir}/rpt.jar" basedir="${classes.src}" excludes="**/*.java" />
This target is used to package files into a jar archive
Destfile: Specifies the name and location of the target file, that is, the archive to be created
Basedir: Specifies the base directory of the files to be packaged Note that all files and subfolders will be included
Exclude: This is used to exclude files (jars) from your package on an unnecessary basis
Now answer your question
What the above statement will do is that it will put classes All files in SRC are packaged in $(LIB. DIR) / RPT Jar, but any found in any subfolder or inside basedir will be excluded Java file
Edit: This exclude = "* /. Java" is usually used to exclude the source code of jars to be used, distributed, exported, etc