在 Eclipse 中添加 SVN 存储库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/85486/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Adding a SVN repository in Eclipse
提问by Baltimark
I'm trying to add an SVN repository to Eclipse.
我正在尝试向 Eclipse 添加一个 SVN 存储库。
I've installed Subclipse, and it seems to be working fine. But, when I try to "add a new SVN repository", I input this, for example:
我已经安装了Subclipse,它似乎工作正常。但是,当我尝试“添加新的 SVN 存储库”时,我输入了以下内容,例如:
http://svn.python.org/projects/peps/trunk
http://svn.python.org/projects/peps/trunk
I get this:
我明白了:
Error validating location: "org.tigris.subversion.javahl.ClientException: RA layer request failed svn: OPTIONS of 'http://svn.python.org/projects/peps/trunk': could not connect to server (http://svn.python.org) " Keep location anyway?
验证位置时出错:“org.tigris.subversion.javahl.ClientException:RA 层请求失败 svn:' http://svn.python.org/projects/peps/trunk'的选项:无法连接到服务器(http:// /svn.python.org) " 仍然保持位置?
I know that my Eclipse can connect to the Internet, because I downloaded Subclipse earlier (I had to change my proxy settings).
我知道我的 Eclipse 可以连接到 Internet,因为我之前下载了 Subclipse(我不得不更改我的代理设置)。
I get a similar message for other SVN locations I've tried to add.
对于我尝试添加的其他 SVN 位置,我收到了类似的消息。
What is the solution?
解决办法是什么?
回答by Jacob Block
This is a dead topic, but the solution is to install a client adapter along with Subclipse.
这是一个死的话题,但解决方案是安装一个客户端适配器和 Subclipse。
Take a look at this, and install SVN Client Adapter, SVNKit Adapter, and SVNKit Library.
看看这个,安装 SVN Client Adapter、SVNKit Adapter 和 SVNKit Library。
Then check under Window -> Preference -> Team -> SVN and make sure there is an entry for SVN Interface.
然后在 Window -> Preference -> Team -> SVN 下检查并确保有一个 SVN Interface 条目。
And for future reference, if you can connect to the repository through the command line, then it must be a problem with the IDE.
并且为了以后参考,如果可以通过命令行连接到repository,那一定是IDE的问题。
回答by Popeye
It worked for me, In eclipse: Window > Preference > Team > SVN: select SVNKit (Pure Java)instead JavaHL(JNI)
它对我有用,在 eclipse: Window > Preference > Team > SVN: 选择SVNKit (Pure Java)而不是JavaHL(JNI)
回答by Dor
At my day job I sit behind a corporate firewall protecting and caching web traffic (among other things). For the most part it stays out of the way. But sometimes it rears its ugly head and stands firmly in the path of what I am trying to do.
在我的日常工作中,我坐在公司防火墙后面保护和缓存网络流量(除其他外)。在大多数情况下,它不会碍事。但有时它会抬起它丑陋的脑袋,坚定地站在我想要做的道路上。
Earlier this week I was trying to look at a cool new general validation system for ColdFusion called Validat, put out by the great guys at Alagad. They don't have a download on the RIAForge site yet, but the files are available via SVN. I loaded up the subclipse plugin into my Eclipse, restarted and began adding the Validat SVN repository. I started getting errors abou the "RA layer request failed" and "svn: PROPFIND request failed on /Validat/trunk", followed by an error about not being able to connect to the SVN server.
本周早些时候,我试图研究一个很酷的新的 ColdFusion 通用验证系统,称为 Validat,由 Alagad 的伟人推出。他们还没有在 RIAForge 站点上下载,但是可以通过 SVN 获得这些文件。我将 subclipse 插件加载到我的 Eclipse 中,重新启动并开始添加 Validat SVN 存储库。我开始收到关于“RA 层请求失败”和“svn:PROPFIND 请求在 /Validat/trunk 上失败”的错误,然后是关于无法连接到 SVN 服务器的错误。
I already had Eclipse setup with my proxy settings, so I thought I was doing something wrong or Alagad didn't actually have the subversion repository up-and-available. After going home that night, I tried it from home and wa-la it worked. Stupid proxy server! So the subclipse plugin won't use the Eclipse proxy settings. (Can that be fixed please!). After digging around the subclipse help site and being redirected to the collab.net help, then unproductively searching through the eclipse workspace, plugins, and configuration folders for the settings file, I was finally able to figure out how to set up subclipse to use the proxy server.
我已经用我的代理设置设置了 Eclipse,所以我认为我做错了什么,或者 Alagad 实际上没有启动和可用的 subversion 存储库。那天晚上回家后,我在家里试了一下,哇啦它奏效了。愚蠢的代理服务器!所以 subclipse 插件不会使用 Eclipse 代理设置。(可以修复吗!)。在搜索 subclipse 帮助站点并重定向到 collab.net 帮助,然后在 eclipse 工作区、插件和配置文件夹中搜索设置文件后,我终于弄清楚了如何设置 subclipse 以使用代理服务器。
In my Windows development environment, I opened the following file: C:\Documents and Settings\MyUserId\Application Data\Subversion\servers in my favorite text editor. Near the bottom of that file is a [global] section with http-proxy-host and http-proxy-port settings. I uncommented those two lines, modified them for my corporate proxy server, went back to the SVN Repository view in Eclipse, refreshed the Validat repository and Boom! it worked!
在我的 Windows 开发环境中,我在我最喜欢的文本编辑器中打开了以下文件:C:\Documents and Settings\MyUserId\Application Data\Subversion\servers。该文件底部附近是 [global] 部分,其中包含 http-proxy-host 和 http-proxy-port 设置。我取消了这两行的注释,为我的公司代理服务器修改了它们,返回到 Eclipse 中的 SVN 存储库视图,刷新了 Validat 存储库和 Boom!有效!
from http://www.mkville.com/blog/index.cfm/2007/11/8/Using-Subclipse-Behind-a-Proxy-Server
来自http://www.mkville.com/blog/index.cfm/2007/11/8/Using-Subclipse-Behind-a-Proxy-Server
回答by Harish
When trying to connect to the Collabnet subversion from eclipse I was also getting the same error as 'Peter Hilton' described in his original post. I changed the settings of Active Provided from 'Native' to 'manual' in windows->Preferences->General->Network Connections. This worked for me. I think this was a proxy problem but with my old settints eclipse was connecting to the internet from where i DOWNLOADED THE subversion plugins.
当尝试从 Eclipse 连接到 Collabnet subversion 时,我也遇到了与他原始帖子中描述的“Peter Hilton”相同的错误。我在 windows->Preferences->General->Network Connections 中将 Active Provided 的设置从“本机”更改为“手动”。这对我有用。我认为这是一个代理问题,但是使用我的旧设置,eclipse 正在从我下载 subversion 插件的地方连接到互联网。
回答by bengineerd
Try to connect to the repository using command line SVN to see if you get a similar error.
尝试使用命令行 SVN 连接到存储库,看看是否出现类似的错误。
$ svn checkout http://svn.python.org/projects/peps/trunk
If you keep getting the error, it is probably an issue with your proxy server. I have found that I can't check out internet based SVN projects at work because the firewall blocks most HTTP commands. It only allows GET, POST and others necessary for browsing.
如果您不断收到错误消息,则可能是您的代理服务器存在问题。我发现我无法在工作中检查基于 Internet 的 SVN 项目,因为防火墙阻止了大多数 HTTP 命令。它只允许 GET、POST 和其他浏览所需的操作。
回答by danivovich
I doubt that Subclipse and then SVN can use your Eclipse proxy settings. You'll probably need to set the proxy for your SVN program itself. Trying to check out the files using SVN from the command line should tell you if that works.
我怀疑 Subclipse 然后 SVN 可以使用您的 Eclipse 代理设置。您可能需要为您的 SVN 程序本身设置代理。尝试从命令行使用 SVN 检出文件应该会告诉您这是否有效。
If SVN can't connect either then put the proxy settings in your servers file in your Subversion settings folder (in your home folder).
如果 SVN 也无法连接,则将代理设置放在 Subversion 设置文件夹(在您的主文件夹中)的服务器文件中。
If it can't do it even with the proxy settings set, then your firewall is probably blocking the methods and protocols that Subversion needs to use to download the files.
如果即使设置了代理设置也不能这样做,那么您的防火墙可能阻止了 Subversion 下载文件需要使用的方法和协议。
回答by Mark Phippard
It is probably of little help to you, but I enter that URL into Subclipse and the repository adds fine and I can browse and Show History on it.
它可能对您帮助不大,但我将该 URL 输入到 Subclipse 中,存储库添加得很好,我可以浏览并在其上显示历史记录。
Do you perhaps need to configure a proxy? You have to configure that in the Subversion runtime configuration area as Subclipse uses the Subversion libraries to connect to the server.
您可能需要配置代理吗?您必须在 Subversion 运行时配置区域中进行配置,因为 Subclipse 使用 Subversion 库连接到服务器。
回答by Mike Tunnicliffe
Do you have any working repositories in this instance of eclipse?
在这个 eclipse 实例中,你有任何可用的存储库吗?
I've had problems in the past with the default Subclipse subversion client on Windows, you need to make sure the native subversion client is installed and correctly configured (I've got TortoiseSVN to work in the past) if you want to use the default client adapter.
我过去在 Windows 上使用默认的 Subclipse subversion 客户端时遇到过问题,如果要使用默认值,则需要确保安装并正确配置了本机 Subversion 客户端(我过去使用 TortoiseSVN)客户端适配器。
On a recent install I tried the "beta" drivers (I have Eclipse Ganymede and "SVNKit (Pure Java) SVNKit v1.2.0.4502") that you can optionally install with Subclipse and they worked pretty much straight out of the box, although a colleague found he had to go through a few hoops to make sure Eclipse installed them (and their dependancies) correctly.
在最近的一次安装中,我尝试了“测试版”驱动程序(我有 Eclipse Ganymede 和“SVNKit (Pure Java) SVNKit v1.2.0.4502”),您可以选择使用 Subclipse 安装它们,它们开箱即用,尽管一位同事发现他必须通过几个环节来确保 Eclipse 正确安装它们(及其依赖项)。
Here are the packages that appear in "Help" -> "Software Updates" -> "Installed Software":
以下是出现在“帮助”->“软件更新”->“已安装软件”中的软件包:
Subclipse 1.4.0
Subversion Client Adapter 1.5.0.1
SVNKit Client Adapter 1.5.0.1
SVNKit Library 1.2.0.4502
These are probably a little out of date now, and the latest version will probably work better, but this is what I can see working right now.
这些现在可能有点过时了,最新版本可能会更好地工作,但这是我现在可以看到的工作。
回答by PHON
I found this problem when I changed my SVN password.
我在更改 SVN 密码时发现了这个问题。
How to resolve First, remove Subversion folder in {Documents and Settings}{user login}\Application Data\Subversion -> It doesn't work
如何解决 首先,删除 {Documents and Settings}{user login}\Application Data\Subversion 中的 Subversion 文件夹 -> 它不起作用
After, rename my current user login profile from {Documents and Settings}{user login} to {Documents and Settings}{user login}_bakup and login agian -> It work...
之后,将我当前的用户登录配置文件从 {Documents and Settings}{user login} 重命名为 {Documents and Settings}{user login}_bakup 并登录 agian -> 它工作...
I assumed -> SVN or JavaHL bind authorized user with {user login} or keep it in user profile of window.
我假设 -> SVN 或 JavaHL 将授权用户与 {user login} 绑定或将其保留在窗口的用户配置文件中。
回答by pedrobisp
I was facing this problem and, as mentioned previously here, I changed the "servers" file under Subversion folder in "C:\Users\userid\AppData\Roaming\Subversion". There, in the file's bottom, there is a [global] section. I removed the comments from
我遇到了这个问题,如前所述,我更改了“C:\Users\userid\AppData\Roaming\Subversion”中 Subversion 文件夹下的“servers”文件。在那里,在文件的底部,有一个 [global] 部分。我删除了评论
http-proxy-host
http-proxy-port
http-proxy-username
http-proxy-password
http-proxy-host
http-proxy-port
http-proxy-username
http-proxy-password
I set those guys and it worked! :-)
我设置了那些家伙,它奏效了!:-)