eclipse svn project 哪些文件不应该check in ?

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 等等东西一个一个输入就可以了,这样貌似可以一劳永逸



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值