This is probably a well-known fact for everyone who has used Ant on Unix for a while, but an annoying discovery for me who have been hiding under a C++ rock. The five year old bug report File Permissions not preserved in replace task pretty much says it all: Java couldn’t stat files, and it seems like it still can’t.
Update The “replace” task destroys file ownership too, of course.
One Reply to “Ant “replace” task does not preserve Unix file permissions”
Use “chmod” task to change file permissions.