pxnx

Ant Tar task doesn’t care about your file permissions

According to the documentation for the Ant Tar task, the “implicit fileset” of stuff to be included in your archive can be extended “to allow control over the access mode, username and groupname.”  I guess you have to read between the lines (or go with the ol’ trial by error) to find out that not only does the implicit fileset provide no control over these properties of your files, it actively reverts the file permissions to some default access mode (644).  Java ftw!

So you are hypothetically deploying your ant-built tar’d up software release. Let’s further say for the sake of argument that it contains some business-critical scripts that must keep their executable mode to be run from cron. Oops, those files are no longer executable! You will soon be disappointed at the failure of your cron job to do anything at all, and you may experience some increased email volume accompanied by mild irritation.  If this condition persists, call your doctor, or go back and RTFM again because as the docs imply, this shortcoming can be easily overcome.

Read the rest of this post »