Java 在 Eclipse 中导入多个同名项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19731642/
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
Importing multiple projects with the same name in Eclipse
提问by cassiomolin
I have multiple projects with the same name in different directories.
我在不同的目录中有多个同名的项目。
How can I import them in the same workspace in Eclipse?
如何在 Eclipse 的同一个工作区中导入它们?
采纳答案by César Cobo
You can change the name
tag in the .project
file in every project that you want to import before importing it
您可以name
在.project
导入之前更改要导入的每个项目中的文件中的标签
回答by Samuel O'Malley
When you import existing projects (depending on your Eclipse version) you can give it a new name in the import window. Otherwise import it as normal and rename it by right clicking the project in your Package Explorer and going Refactor > Rename
.
当您导入现有项目(取决于您的 Eclipse 版本)时,您可以在导入窗口中为其指定一个新名称。否则正常导入并通过右键单击包资源管理器中的项目并转到Refactor > Rename
.
If you want to keep the original names then as Juned Ashan said, untick the Copy Projects into Workspace
checkbox and the files will remain in their original locations and will not interfere with each other.
如果您想保留原始名称,那么就像 Juned Ashan 所说的那样,取消Copy Projects into Workspace
选中该复选框,文件将保留在其原始位置,不会相互干扰。
回答by Juned Ahsan
Try doing this:
尝试这样做:
Uncheck "copy projects into workspace" checkbox while importing the project with the same
在导入项目时取消选中“将项目复制到工作区”复选框
回答by Rupesh
There is an advance option available in eclipse and there you can provide the details asked and it should work...
eclipse 中有一个高级选项,您可以在那里提供所询问的详细信息,它应该可以工作...
Right Click >> Import >> "Select option Import Existing Maven Projects or from an archive file or directory" >> Advanced
右键单击>>导入>>“选择选项导入现有的Maven项目或从存档文件或目录”>>高级
回答by objectuser
Instead of importing the project, begin creating a new project with a different name. Then change the location of the project to your new existing project. Eclipse will then let you create the project using the existing directory and content.
不要导入项目,而是开始创建一个具有不同名称的新项目。然后将项目的位置更改为新的现有项目。然后 Eclipse 将让您使用现有目录和内容创建项目。
回答by Abhijeet
回答by BILAL YILDIZ
If you have same names as Maven Project I assume that you will have the same classes or feature files too. In that case, you most likely will have some conflicts when you try to run your feature files or pull/push from a repository.
如果您的名称与 Maven 项目相同,我假设您也将拥有相同的类或功能文件。在这种情况下,当您尝试运行功能文件或从存储库拉取/推送时,您很可能会遇到一些冲突。
There is an easy way to solve the problem: delete the oldest version from the remote repository and from your working space, and make your project unique. If you still get the same problem even running your feature file as Cucumber I strongly recommend checking your reference points, as you may need to change them manually.
有一个简单的方法可以解决这个问题:从远程存储库和您的工作空间中删除最旧的版本,并使您的项目独一无二。如果您在将特征文件作为 Cucumber 运行时仍然遇到同样的问题,我强烈建议您检查参考点,因为您可能需要手动更改它们。