0

假设我在 Eclipse 中有 n 个项目,它们只是在概念上连接。

如何将这些项目中的每一个作为一个包添加到一个新的伞形项目中?

4

2 回答 2

2

在 Eclipse 中,您可以使用构建路径配置对话框中的 Project 选项卡将项目连接在一起:

  • 右键单击您的高阶项目
  • 选择构建路径
  • 选择配置构建路径...
  • 选择项目选项卡并添加其他项目作为参考

您也可以将Maven视为构建管理系统,它允许您创建可使用的库。您的每个项目都将使用 Maven 生成 JAR 工件,并且您的伞形项目将使用 Maven 将它们作为依赖项引用。我相信常春藤在这方面也会对你有所帮助。

于 2013-10-23T18:54:12.117 回答
0

In order to logically combine the elements (in this case, projects) together, you can create a "Working Set" in Eclipse. There can be different type of working set.

Here are steps to create a Java working set (as the question is tagged as Java):

  1. File - New - Others..
  2. Select "Java Working Set" under Java.
  3. Select the project you want to add into the working set and give a

Once the working set is created, you can use it at many place in eclipse. Personally I use them a lot in search to narrow the search results and on Package/Project Explorer to see only the projects I am interested in at the moment.

To emphasize that the Java working sets are just logical grouping of the projects, here are couple of examples.

  • Working sets "Batch Projects" and "Web Projects" based on type.
  • Working sets "SVN Projects" and "CVS Projects" based on the source repository.

Read more on the offical eclipse documentation.

于 2013-10-23T19:48:37.810 回答