# [java] Ignoring .svn folders in Eclipse

This topic is 2923 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Basically what I need to know is how to make Eclipse ignore .svn folders when exporting to an executable .jar file.

I am using Ecliipse to export my project to an executable .jar file. I am also using SVN for source control. This means that I have lots of .svn folders scattered inside of my source code folder. When I build the .jar file it works alright, the only trouble is the .svn folders are also added to the .jar file. How do I stop this happening?

I have tried going to WIndows->Preferences->Java->Compiler->Bulding and adding .svn/ to filtered resources but no dice.

##### Share on other sites
I've had similar problems myself. I've never found a way to get wild card entries to work properly, I had to specify a relative path for every .svn directory to exclude.

The only reliable way I've found todo this, is by using an ANT script.
I think recent versions will exclude .svn folders by default. But to be safe try something like this:

You'll need to replace the export properties with correct path & filename.

 <?xml version="1.0" encoding="UTF-8" standalone="no"?> <project basedir="." default="export_jar" name="Game Ant Scripts"> <!-- ============================================================================== --> <!-- Generic Properties --> <property name="exclude.default" value="**/.svn,**/.svn/**"/> <!-- ============================================================================== --> <!-- Export Properties --> <property name="export.path" location="C:/PATH_TO_EXPORT/${ant.project.name}"/> <property name="jar.name" value="game.jar"/> <!-- ============================================================================== --> <target name="export_jar" description="Export the game as a jar"> <jar destfile="${export.path}/${jar.name}" compress="true"> <zipfileset dir="bin" includes="**/*.class" excludes="${exclude.default}" /> </jar> </target> </project> 

* Create a "Build.xml" in the root project folder.
* Replace contents with code above.
* In Eclipse: "Window -> Show View -> Ant"
* Right click, empty white space of Ant window. "Add Build files".
* Browse to the "Build.xml".
* You should see a tree view of "Game Ant Scripts -> export_jar".
* Right click "export_jar", and select "RunAs Ant".

##### Share on other sites
Have you tried installing one of the Subversion plugins for Eclipse? Maybe once Eclipse is svn aware it will automatically ignore Subversion related folders for you

##### Share on other sites
I tried the ant script and it worked, so thanks for that. Haven't tried any subversion plugins. Probably try that next.

##### Share on other sites

<classpathentry excluding="**/.svn/*" kind="src" path="src"/>

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 9
• 15
• 21
• 26
• 11