简体   繁体   English

如何将SVN项目作为Java项目签入Eclipse?

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

I was trying to check out a project from SVN using Eclipse. 我试图使用Eclipse从SVN检查一个项目。 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. 我尝试使用“Checkout As”将其变为“来自现有Ant脚本的Java项目”,但项目向导要求已经下载了该文件。 Is there a way to checkout the project into Eclipse as a Java project, without having to download it elsewhere first? 有没有办法将项目签入Eclipse作为Java项目,而不必先将其下载到其他地方?

(I am using Eclipse Ganymade 3.4.1 with Subversive.) (我正在使用带有Subversive的Eclipse Ganymade 3.4.1。)

Here are the steps: 以下是步骤:

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

It seems you are checking the .project file into the source repository. 您似乎正在将.project文件检入源存储库。 I would suggest not checking in the .project file so users can have their own version of the file. 我建议不要检查.project文件,以便用户可以拥有自己的文件版本。 Also, if you use the subclipse plugin it allows you to check out and configure a source folder as a java project. 此外,如果您使用subclipse插件,它允许您签出并配置源文件夹作为Java项目。 This process creates the correct .project for you(with the java nature), 这个过程为你创建了正确的.project(具有java性质),

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

I had to add the .classpath too, form a java project. 我不得不添加.classpath,形成一个java项目。 I made a dummy java project and looked in the workspace for this dummy java project to see what is required. 我创建了一个虚拟java项目,并在工作区中查找这个虚拟Java项目以查看所需内容。 I transferred the two files. 我转移了两个文件。 profile and .claspath to my checked out, and disconnected source from my subversion server. 我检出的配置文件和.claspath,以及我的subversion服务器断开连接的源。 From then on it turned to a java project from just a plain old project. 从那时起,它从一个普通的旧项目变成了一个java项目。

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. 但是不要选择“trunk”(例如)来加速它。 You must select all the projects you want to check out and proceed. 您必须选择要签出的所有项目并继续。 Eclipse will than recognize them as such. Eclipse将会识别它们。

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

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