Eclipse 中的嵌套项目和项目文件夹
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22459126/
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
Nested projects and project folders in Eclipse
提问by Dims
Maven allows parent-child relationship between projects. By default, parent project is expected locating in parent folder.
Maven 允许项目之间的父子关系。默认情况下,父项目应位于父文件夹中。
Is it possible to adopt this structure to Eclipse?
Eclipse 可以采用这种结构吗?
Currently I have imported all folders separately as project with sources without copying and consequently have separate nodes for each project in Package Explorer
.
目前,我已将所有文件夹作为项目单独导入,而无需复制,因此Package Explorer
.
Unfortunately it causes various glitches including EGit
functionning.
不幸的是,它会导致各种故障,包括EGit
功能故障。
回答by Mickael
Eclipse 4.5 (starting from Mars M5) will include a mechanism that allows to nested projects under their parent one. You can already give it a try by accessing the latest snapshot build of Eclipse Platform (which is a subset of the IDE, but which contains the change) http://download.eclipse.org/eclipse/downloads/drops4/N20150124-1500/, when Mars M5 is ready, you'll be able to access from http://eclipse.org/downloadsa full featured IDE which also contains this feature.
Eclipse 4.5(从 Mars M5 开始)将包含一种机制,允许在其父项下嵌套项目。您已经可以通过访问 Eclipse 平台的最新快照版本(它是 IDE 的一个子集,但包含更改)来尝试一下http://download.eclipse.org/eclipse/downloads/drops4/N20150124-1500 /,当 Mars M5 准备就绪时,您将能够从http://eclipse.org/downloads访问一个包含此功能的全功能 IDE。
Reference https://bugs.eclipse.org/bugs/show_bug.cgi?id=427768
回答by Chandrayya G K
Check this answer. Eclipse Workspace Pluginmanages the resources in this hierarchy(or structure) and also exposes the APIs to handles these resources programmatically in the similar way.
检查这个答案。Eclipse Workspace Plugin管理此层次结构(或结构)中的资源,并公开 API 以类似方式以编程方式处理这些资源。
All projects inside eclipse are identified by the presence of .projectfile inside the project folder. Refer this answer
eclipse 中的所有项目都通过项目文件夹中的.project文件来标识。参考这个答案
回答by Nicola Musatti
If you already store your projects as Maven expects them, i.e. the aggregator project in the top level directory and all its modules each in its own direct subdirectory you should be able to view modules as full fledged Eclipse projects by running import -> Maven -> Existing Maven projects
and then selecting the aggregator project's directory.
如果您已经按照 Maven 期望的方式存储了您的项目,即顶级目录中的聚合器项目及其所有模块都在其自己的直接子目录中,那么您应该能够通过运行import -> Maven -> Existing Maven projects
然后选择聚合器项目的目录。
If this is not your structure it's more complicated if not impossible. With Subversion you can use externals to "hook" sub-projects to their aggregator, but I don't know if git supports a similar mechanism.
如果这不是你的结构,它会更复杂,如果不是不可能的话。使用 Subversion,您可以使用 externals 将子项目“挂钩”到它们的聚合器,但我不知道 git 是否支持类似的机制。