How to exclude subversion hidden directories (.svn) using Ant

Many Java developers already know that Ant is a great build tool. Besides a build tool you also need a good version control system to manage the various versions of your code. For this purpose I often use Subversion. Now, there might be time when you need to exclude the Subversion hidden directories from, for example, a backup Ant target you built. To do that you just need to use the following attribute to your zipfileset or other directory-based task:

<zipfileset dir="${basedir}" excludes="**/.svn/*" prefix="${}" />

In particular, the previous code excludes all the .svn directories, that are under the basedir directory and its subdirectories, recursively.