How to suppress ant jar warnings for duplicates?

This is an older question, but there is one obvious way to exclude the duplicates warning, do not include the duplicate files. You could do this in one of two ways.

Up vote 1 down vote favorite share g+ share fb share tw.

I don't want ant's jar task to notify me every time it skips a file because the file has already been added. I get reams of this: jar xml/dir1/dir2. Dtd already added, skipping Is there a way to turn this warning off?

Ant link|improve this question asked Oct 1 '09 at 18:40skiphoppy7,1481364130 69% accept rate.

This is an older question, but there is one obvious way to exclude the duplicates warning, do not include the duplicate files. You could do this in one of two ways: Exclude the duplicate files in some fashion, or Copy the files to a staging area, so that the cp task deals with duplicates, not the jar task. So, instead of doing: do one of: or Edit: Base on the comment to this answer, there is a third option, although it is a fair bit more work... You can always get the source to the jar task, and modify it so that it does not print out the warnings.

You could keep this as a local modification to your tree, move it to a different package and maintain it yourself, or try to get the patch pushed back upstream.

I emphatically don't want any staging areas. I am trying to get rid of too many staging areas right now. – skiphoppy Jan 19 '10 at 17:34.

I don't know of any options on the jar task to suppress these messages, unless you run the whole build with the -quiet switch, in which case you may not see other information you want. In general if you have lots of duplicate files it is a good thing to be warned about them as a different one may be added to that which you expect. This possibly indicates that a previous target of the build has not done its job as well as it might, though obviously without more details it is impossible to say.

Out of interest why do you have the duplicate files?

I am collapsing several directories of XML files down to one in creating the jar. The duplicates are DTDs. Basically: /xml/data/.

{xml,dtd} -> data. Jar (files named in jar as xml/data/*. Xml) /xml/params/.

{xml,dtd} -> params. Jar (files named in jar as xml/params/*. Xml) I'm tinkering with an existing system that already does this, and I need to retain the same structure as much as possible.

I just need to build it with ant instead of horrible custom code. – skiphoppy Oct 5 '09 at 16:51 That didn't come out right - read an asterisk before /xml/data and /xml/params and you'll have what I typed. :) – skiphoppy Oct 5 '09 at 16:52.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions