如何将 SVN 项目作为 Java 项目检出到 Eclipse 中?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/408110/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 14:16:55  来源:igfitidea点击:

How do I check out an SVN project into Eclipse as a Java project?

javaeclipsesvnantsubversive

提问by Hosam Aly

I was trying to check out a project from SVN using Eclipse. I tried using "Checkout As" to make it into a "Java project from existing Ant script", but the project wizard requires the file to have already been downloaded. Is there a way to checkout the project into Eclipse as a Java project, without having to download it elsewhere first?

我试图使用 Eclipse 从 SVN 签出一个项目。我尝试使用“Checkout As”使其成为“来自现有 Ant 脚本的 Java 项目”,但项目向导要求已下载该文件。有没有办法将项目作为 Java 项目检出到 Eclipse 中,而不必先在别处下载它?

(I am using Eclipse Ganymade 3.4.1 with Subversive.)

(我正在使用 Eclipse Ganymade 3.4.1 和 Subversive。)

采纳答案by Brandon

If it wasn't checked in as a Java Project, you can add the java nature as shown here.

如果未选中作为一个Java项目,您可以添加Java性质如图所示这里

回答by neesh

Here are the steps:

以下是步骤:

  • Install the subclipse plugin (provides svn connectivity in eclipse) and connect to the repository. Instructions here: http://subclipse.tigris.org/install.html
  • Go to File->New->Other->Under the SVN category, select Checkout Projects from SVN.
  • Select your project's root folder and select checkout as a project in the workspace.
  • 安装 subclipse 插件(在 eclipse 中提供 svn 连接)并连接到存储库。这里的说明:http: //subclipse.tigris.org/install.html
  • 转到 File->New->Other-> 在 SVN 类别下,选择 Checkout Projects from SVN。
  • 选择您的项目的根文件夹并选择 checkout 作为工作区中的一个项目。

It seems you are checking the .project file into the source repository. I would suggest not checking in the .project file so users can have their own version of the file. Also, if you use the subclipse plugin it allows you to check out and configure a source folder as a java project. This process creates the correct .project for you(with the java nature),

您似乎正在将 .project 文件签入源存储库。我建议不要签入 .project 文件,以便用户可以拥有自己的文件版本。此外,如果您使用 subclipse 插件,它允许您检出源文件夹并将其配置为 Java 项目。此过程为您创建正确的 .project(具有 Java 性质),

回答by neesh

I had to add the .classpath too, form a java project. I made a dummy java project and looked in the workspace for this dummy java project to see what is required. I transferred the two files. profile and .claspath to my checked out, and disconnected source from my subversion server. From then on it turned to a java project from just a plain old project.

我也必须添加 .classpath,形成一个 java 项目。我创建了一个虚拟 java 项目并查看了这个虚拟 java 项目的工作区以查看需要什么。我转移了这两个文件。profile 和 .claspath 到我签出的,并从我的 subversion 服务器断开源。从那时起,它从一个普通的旧项目变成了一个 java 项目。

回答by Lycone

If the were checked as plugin-projects, than you just need to check them out. But do not select the "trunk"(for example) to speed it up. You must select all the projects you want to check out and proceed. Eclipse will than recognize them as such.

如果它们被检查为插件项目,那么您只需要检查它们。但是不要选择“中继”(例如)来加速它。您必须选择要签出的所有项目并继续。Eclipse 会这样识别它们。