Possible Duplicate:
Ignore SVN files when exporting a WAR file from Eclipse?
Using eclipse + tomcat.
When I export a tomcat war file for my project, the war file contains all the .svn directories. This is doubling the size of the war file and making deployments much longer than they need to be.
Is there a way to either mask these directories from the export mechanism (like a tar --exclude-from) or remove them from the war (tar --delete) ?
Go to the project properties > Resource > Resource Filters. Add... > Exclude All > Files and Folders > All children (recursive) > name matches *.svn > OK.
All .svn files and folders will be ignored, including when you export war files.
Go to the project properties, Java Build Path, select the Source tab. For each source directory, there are Included: and Excluded: lines. Put a pattern into the exclusions (something like **/.svn).
What happens is that the builder copies anything that isn't a Java source file into the output folder as part of the build, unless it is in the exclusion list.
I usually build war's with ant even if I use Eclipse, have in mind that the svn specific directories is only part of it... you may find jar's you don't want in your application (shared JAR's for aexample) and ant has got a lot of fileset options to exclude files.
精彩评论