How to setup an Eclipse Project with multiple Subprojects (OSGi-Bundles)

故事扮演 提交于 2019-12-04 03:15:41

问题


Sherlog is an OSGi-based log analyzer, if I import this project as an workspace snapshot I receive lot's of projects in my workspace, but I would prefere to have them as subprojects in a project.

The other option would be to checkout from svn, but then I face other problems (I don't know how to setup the dependencies for automatically build)

Does anyone have an idea or good links on this topic? Thanks


回答1:


EDIT: For Eclipse 4.5 and newer please see https://stackoverflow.com/a/34134833/53897


Eclipse does not support subprojects. The Eclipse way of life is one or more projects in a workspace (perhaps using work sets to avoid seeing them all).

As a consequence we have established an approach where we switch workspaces when switching projects. Team Projects are nice for this for CVS. For git I do a separate clone for each workspace as the Maven support in Eclipse does not pick up changes in the pom hierarchy (like a new project) easily.




回答2:


As of Eclipse 4.5 (starting from Mars M5) subprojects are supported. Either import a multi module maven project like here.

Or create a directory structure like this.

BaseProj
----.project
----JavaSubProject1
--------.project
--------.classpath
--------src
--------JavaSubProject2
------------.project
------------.classpath
------------src

Use 'File->Import->Existing Projects into Workspace' and import only BaseProj. It will import all projects. Be sure to activate hierarhical view in Project Explorer.

Later edit - When using import dialog, check 'Search for nested projects' otherwise only BaseProj will be created.



来源:https://stackoverflow.com/questions/2616746/how-to-setup-an-eclipse-project-with-multiple-subprojects-osgi-bundles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!