---
title: "eclipse svn 忽略 target目录"
author: "lliu26"
date: "2014-04-21T17:40:08Z"
tags: ["Eclipse", "SVN", "target"]
categories: ["非技术"]
slug: "eclipse-svn-target"
draft: false
lastmod: "2014-04-21T17:40:08Z"
id: 2051447
url: "https://lliu26.iteye.com/blog/2051447"
---

转自：http://blog.csdn.net/jbgtwang/article/details/7343417

 

 

这个build失败的解决方案就是不要把你项目的 **target**目录放在src repository 里面，还有 **.project** 和 **.classpath**最好也别放到src repository 里。

具体的做法就是在新建项目的时候，在第一次commit 到 SVN 之前，先在项目的根目录设置一个 SVN 属性（我在**eclipse 3.3** 中，SVN插件是**subclipse 1.4.0**）：  
在eclipse中，右键点击项目根目录 Team -&gt; Set Property ... 然后在弹出的对话框中，Property name 选 “**svn:ignore**”，Property Content 输入：

**target**  
**.project**  
**.classpath**  
**.settings**

就ok了。完了进入你的 SVN 的repository 里把已经commit进去的target目录和这两个文件(.classpath .project) 删除就可以了。

我是这样了之后每次build都成功了，呵呵。

还有种办法是在 Windows -&gt; Preferences -&gt; Team -&gt; Ignored Resources里点 “Add Pattern”，然后把 target 等等东西一个一个输入就可以了，这样貌似可以一劳永逸。。。