Eclipse项目往往会有如下的一些目录和文件,我们应该把它们也check in 到server 里吗?
- src
- build.xml
- .project
- .classpath
- .settings/
If you check in .classpath/.project/.settings you make your project Eclipse-specific. What about developers who work with Netbeans or IntelliJ? IMO (In my opinion) it is cleaner to keep your project IDE-independent and easy to set up.
I usually go for a Maven2 build. The pom.xml specifies all the required dependencies and 'mvn eclipse:eclipse' generates the .classpath/.project files for you.
The .settings directory contains local settings (like which Java version you want to use). IMO it is not useful to check this in. You can enforce Java version compliance via the Maven2 pom.
Finally, for your next project, my protip is to svn-ignore the files or directories you don't want in SVNbefore your first commit. In a Maven2 setup that would be .settings .classpath .project target (the default output directory of Maven2) and any other generated stuff (log files, gfembed directories, etc). In your case you would ignore build and dist instead of target.
You can svn-ignore files or directories with RIGHT_MOUSE->Team->'Add to svn:ignore' (I use the Subclipse plugin). Ignore instructions are stored as 'svn-properties' on the parent directory.
(右键点击项目根目录 Team -> Set Property ... 然后在弹出的对话框中,Property name 选 “svn:ignore”,Property Content 输入:
target
.project
.classpath
.settings 或者
在 Windows -> Preferences -> Team -> Ignored Resources里点 “Add Pattern”,然后把 target 等等东西一个一个输入就可以了,这样貌似可以一劳永逸)