简体   繁体   English

恢复 Eclipse 颠覆项目连接

[英]Restore Eclipse subversion project connection

I have a project in subversion, which I'm developing using Eclipse.我有一个颠覆项目,我正在使用 Eclipse 进行开发。 I did the original checkout from the svn repository from inside Eclipse.我从 Eclipse 内部的 svn 存储库中进行了原始检查。 All was well for some weeks then for some unknown reason, Eclipse (specifically: subclipse in Ganymede) no longer recognizes my project as being under svn control.几个星期以来一切都很好,然后由于某些未知原因,Eclipse(特别是:Ganymede 中的 subclipse)不再将我的项目识别为处于 svn 控制之下。 The team context-menu only shows the basic "apply patch" / "share this project" menu options.团队上下文菜单仅显示基本的“应用补丁”/“共享此项目”菜单选项。 From the shell, I can still update the project using the svn command line tools, so I know that the svn credentials still work.在 shell 中,我仍然可以使用 svn 命令行工具更新项目,所以我知道 svn 凭据仍然有效。 Other projects under subversion in the same copy of Eclipse still work.同一 Eclipse 副本中颠覆下的其他项目仍然有效。

I realise that I can delete the local copy and check it out again, but I'd rather understand what has gone wrong - fix the problem, rather than mask the symptoms.我意识到我可以删除本地副本并再次检查它,但我宁愿了解出了什么问题 - 解决问题,而不是掩盖症状。 Where does Eclipse store its knowledge of which projects are under version control? Eclipse 在哪里存储关于哪些项目受版本控制的信息? I looked at the .project file and the .settings directory, but couldn't see any obvious mention of svn nature or anything similar, even in the projects that are still working properly.我查看了.project文件和.settings目录,但没有看到任何明显提及 svn 性质或类似内容,即使在仍在正常工作的项目中也是如此。

If you are using sublipse as your SVN provider I recommend doing the following 如果您使用sublipse作为SVN提供程序,我建议您执行以下操作

Team -> Share project is usually enough to connect the metadata. 团队 - >共享项目通常足以连接元数据。

(that is, assuming that the .svn files are still there which they seem to be if you can work on the command line). (也就是说,如果你可以在命令行上工作,假设.svn文件仍然存在。)

Hope this helps as to why this would happen I have no idea 希望这有助于为什么会发生这种情况我不知道

我找到了一个简单的方法来重新导入项目

Just doing Team -> Share Project (per the answer to this question provided by @Paul Whelan) did not work for me. 只做团队 - >分享项目(根据@Paul Whelan提供的这个问题的答案)对我不起作用。 The Share Project wizard acted as though the project was not already in SVN (even though the .svn folder was present for my project). “共享项目”向导的行为就像项目尚未在SVN中一样(即使我的项目中存在.svn文件夹)。

I ended up resolving the issue by uninstalling the Subversive and JavaHL add-ons (via Help | About Eclipse | Installation Details button | Installed Software tab | Uninstall...), and then reinstalling Subversive. 我最终解决了这个问题,卸载了Subversive和JavaHL附加组件(通过Help | About Eclipse | Installation Details按钮| Installed Software选项卡| Uninstall ...),然后重新安装Subversive。 When prompted after restarting Eclipse, I opted to install the SVNKit connector rather than the JavaHL connector. 重新启动Eclipse后出现提示时,我选择安装SVNKit连接器而不是JavaHL连接器。

After having done that, when I once again tried Team -> Share Project..., Eclipse correctly recognized that my project was already present in SVN, and it successfully restored the connection. 完成之后,当我再次尝试Team - > Share Project ...时,Eclipse正确识别出我的项目已经存在于SVN中,并且它成功恢复了连接。

Addendum: it turns out that my problem manifests when I start Eclipse outside the company vpn, with a project in the workspace that is attached to a svn repository inside the vpn. 附录:事实证明,当我在公司vpn外部启动Eclipse时,我的问题就出现了,工作区中的项目附加到vpn中的svn存储库。 Fortunately, switching Eclipse svn plugins from subversive to subclipse did solve it. 幸运的是,将Eclipse svn插件从颠覆切换到subclipse确实解决了它。

Ian 伊恩

From eclipse, I closed the project(s) and reopened which resolved the problem. 从eclipse开始,我关闭了项目并重新打开了解决问题的方法。 All by SVN links are back for all projects in my workspace. 所有SVN链接都返回到我工作区中的所有项目。

I had the same problem and this forum helped me in finding the right answer. 我有同样的问题,这个论坛帮助我找到了正确的答案。

My earlier project was configured using subclipse. 我之前的项目是使用subclipse配置的。 The new eclipse had subvesive. 新的日食有次要的。

Installing subclipse helped me get back the svn options under team! 安装subclipse帮我恢复团队下的svn选项!

Hope it helps someone else. 希望它可以帮助别人。

regards 问候

Anshu Prateek 安舒Prateek

In the Juno release with Subversive, I did: 在使用Subversive的Juno版本中,我做到了:

  • File/Import brings up the Import popup. 文件/导入会弹出导入弹出窗口。
  • From there, select General/Existing Projects in to Workspace. 从那里,选择工作区中的常规/现有项目。
  • In the next pane, you select the root directory. 在下一个窗格中,选择根目录。 Then it will show you all the subdirectories. 然后它会显示所有子目录。 They'll all be selected by default. 它们都将默认选中。
  • Unselect the ones you don't want. 取消选择您不想要的。

It will then "import" your existing directory, which can be used in-place they are already located inside your workspace directory. 然后它将“导入”您现有的目录,该目录可以就地使用,它们已经位于工作区目录中。

Without knowing what platform you're on, I don't know if your problem is similar to mine. 在不知道你在哪个平台上,我不知道你的问题是否与我的相似。 However, I have recently (actually on two different platforms!) had issues where an update to Subversive (or perhaps Eclipse itself, not clear) caused the connectors to no longer load. 但是,我最近(实际上在两个不同的平台上!)有一些问题,Subversive(或者Eclipse本身,不清楚)的更新导致连接器不再加载。 Without the connectors, Subversive cannot connect to a project. 没有连接器,Subversive无法连接到项目。 But Eclipse isn't going to lock you out of your project over that, it'll just remove the SVN-related functionality. 但Eclipse并不会因此而将您锁定在您的项目之外,它只会删除与SVN相关的功能。

Look at the Errors view, which is a log of Eclipse's various errors (class-not-found exceptions, etc.) and see if there are any lines that related to the Subversive components. 查看Errors视图,它是Eclipse的各种错误(类未找到异常等)的日志,并查看是否存在与Subversive组件相关的任何行。 Unfortunately, I can't really recommend a solution-- on my Mac OSX platform it was enough to re-install the Subversive core elements and connectors. 不幸的是,我不能真正推荐一个解决方案 - 在我的Mac OSX平台上,重新安装Subversive核心元件和连接器就足够了。 On my Linux machine (possibly due to an OS upgrade) I'm having to completely re-install Eclipse, as too much cruft has accumulated for me to be able to fully investigate it. 在我的Linux机器上(可能是由于操作系统升级)我不得不完全重新安装Eclipse,因为我已经积累了太多的东西以便能够完全调查它。

Same in my case: .svn dirs were there, but my project didn't support svn actions. 同样在我的情况下:.svn dirs在那里,但我的项目不支持svn动作。

After a bit of poking it turned out that subversive plugin just disappeared after a forced quitting eclipse. 经过一番调查后发现,在强行退出日食后,颠覆插件才消失。

The solution was to (re)install subversive, and now everything is fine again. 解决方案是(重新)安装颠覆性的,现在一切都很好。

Cheers v. 干杯v。

UPDATE: I have switched eclipse to a new version that just didn't have the plugin installed, which is the reason why I had to install it from scratch. 更新:我已经将eclipse切换到一个没有安装插件的新版本,这就是我必须从头开始安装它的原因。

This worked for me: right click-> TortoiseSVN -> Settings -> Icon Overlay properties, Selecting Shell as Status Cache. 这对我有用:右键单击 - > TortoiseSVN - >设置 - >图标覆盖属性,选择Shell作为状态缓存。 Click Ok, Refresh page. 单击确定,刷新页面。

I can reliably reproduce this problem—it happens when checking out certain Maven projects by running "Check out as Maven Project…" not on the folder containing the POM itself but on a parent directory (such as "trunk"). 我可以可靠地重现这个问题 - 当通过运行“Check out as Maven Project ...”而不是在包含POM本身但在父目录(例如“trunk”)上的文件夹中检出某些Maven项目时会发生这种情况。 In this case Subclipse checks out the project without any complaints, putting it in a workspace directory with a placeholder name such as maven.1424425443350 . 在这种情况下,Subclipse会在没有任何投诉的情况下检出项目,将其放在带有占位符名称的工作区目录中,例如maven.1424425443350 Inside this directory it creates a subdirectory with the name of the Maven artifact. 此目录中,它创建一个具有Maven工件名称的子目录。 This confuses both Subclipse and Subversion: Subclipse, as we've seen, immediately forgets that the project is under version control, and if you invoke svn status from the command line in the maven.1424425443350 directory, it will tell you that the directory is under version control but that all the version-controlled files are missing. 这会混淆Subclipse和Subversion:Subclipse,正如我们所见,立即忘记项目受版本控制,如果你从maven.1424425443350目录的命令行调用svn status ,它会告诉你目录是在版本控制下,但缺少所有版本控制的文件。

None of the workarounds presented in the other answers will work if this is what caused Subsclipse to forget its SVN connection. 如果这是导致Subsclipse忘记其SVN连接的原因,那么其他答案中提供的解决方法都不会起作用。 Instead, the only solution is to delete the project and check it out again, this time making sure that the checkout is performed on a directory containing a POM rather than some higher-level directory. 相反,唯一的解决方案是删除项目并再次检出,这次确保在包含POM而不是某个更高级别目录的目录上执行检出。

A better overall solution would be for Subclipse to refuse to run "Check out as Maven Project…" on directories which don't contain a POM, or else to better handle cases where it tries to do so anyway by searching subdirectories for Maven projects. 一个更好的整体解决方案是Subclipse拒绝在不包含POM的目录上运行“Check out as Maven Project ...”,或者更好地处理它试图通过搜索Maven项目的子目录来执行此操作的情况。

I was using two SVNKit implementations (1.7.x and 1.8.x) simultaneously with the SVN repository version (1.8.x). 我在SVN存储库版本(1.8.x)中同时使用了两个SVNKit实现(1.7.x和1.8.x)。

As a result the Team -> Share projects... always requested a commit message. 因此, 团队 - >共享项目......总是请求提交消息。 Obviously, SVNKit 1.7.x was used which is not compatible with SVN 1.8.x. 显然,使用的SVNKit 1.7.x与SVN 1.8.x不兼容。

After removing SVNKit 1.7.x eclipse used the only available correct SVNKit version 1.8.x and everything worked as expected. 在删除SVNKit 1.7.x之后,eclipse使用了唯一可用的正确SVNKit版本1.8.x,一切都按预期工作。

My.svn metadatas folder were deleted. My.svn 元数据文件夹已删除。

None of the solutions here worked for me (close/reopen project, delete/reimport, still unlinked)这里的解决方案都不适合我(关闭/重新打开项目,删除/重新导入,仍然未链接)

Following steps worked for me:以下步骤对我有用:

  • BEFORE ALL backup source project PROJECT/ folder to BAK/在所有备份源项目PROJECT/文件夹到BAK/之前
  • Eclipse > on Project: Eclipse > 在项目上:
    • Delete project, choose yes for "Delete content too?"删除项目,对“是否也删除内容?”选择“是”
    • Team > checkout as fresh project, recursive团队 > 作为新项目签出,递归
    • restores all up-to-date content and the .svn folders 恢复所有最新内容.svn文件夹
  • Close Eclipse关闭 Eclipse
  • Copy / override from BAK/ to PROJECT/ :BAK/复制/覆盖到PROJECT/
    • optional, .classpath and .project files ⇾ restores Project (Java) natures, setup, build path, ... if yours was modified compared to server version (I needed to)可选的.classpath.project文件 ⇾恢复项目(Java)的性质、设置、构建路径,...如果你的相对于服务器版本进行了修改(我需要)
    • optional, all source files and folders ⇾ restores your latest local changes (I needed to)可选,所有源文件和文件夹 ⇾恢复您最新的本地更改(我需要)
  • Open Eclipse打开 Eclipse
  • Eclipse > File > Import project Eclipse > 文件 > 导入项目

The project is now restored, it builds and is linked to subversion again, with the latest local recent changes kept if any.该项目现在已恢复,它构建并再次链接到颠覆,如果有的话,保留最新的本地最近更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM