Document :middleware in sample project.
Fix copy-to-jar duplicate checking for directories.