Slightly modified patch.
Michal, note the new patch file name - the naming convention uses the whole issue ID, including the project (LUCENE).
ant clean-netbeans doesn't need to remove .project and .classpath - AFAICT these are copy-paste-o's from the clean-eclipse target.
Apparently Netbeans thinks .gitignore is binary, since in your patch, Michal, it's Base64-encoded. I've decoded it and included the changes in normal patch format.
I don't use Netbeans, but to test this out I downloaded the Netbeans installer and installed it on OS X, and ran ant netbeans. I was able to open the project and look at files, so it seems to be at least minimally functional.