Got a following build.xml string:
<jar destfile="${lib.dir}/rpt.jar" basedir="${classes.src}" excludes="**/*.java" />
I am new to Ant and i don’t understand how excludes string works. What files are affected? All java source files?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First about the statement
this target is used to package your files inside a jar archive
destfile : specifies the name and location of the destination file, the archive that would be created
basedir : specifies the base directory of the files that needed to be packaged. note that all files and subfolders would be included
excludes : this is used to exclude files from basedir that you dont need inside your package (jar)
Now to your question
what the above statement would do is that it will package all the files inside classes.src to $(lib.dir)/rpt.jar but will exclude any .java files found at or inside any sub folder of basedir.
EDIT :
This exclude=”*/.java” is generally done to exclude source code form the jar which would be used, distributed,exported etc