在eclipse中组织maven的多模块项目。

时间:2023-01-13 12:30:57

I have a huge Maven multi-module project. With similar structure

我有一个大型的Maven多模块项目。类似的结构

parentA
  - subA1
     - subA3
     - subA3
  - subA2

parentB
  - subB1
  - subB2

etc

The problem is, that parentA and subA1 does not contains any code inside it, but I can still see them in project explorer. But I would like to hide them or organize in tree hierarchy like in an explorer. Right now there are over 30 projects and just 20 of them contains Java code. Others simply contains others modules references. I see all 30 projects in plain form in project explorer.

问题是,parentA和subA1中不包含任何代码,但是我仍然可以在project explorer中看到它们。但是我想隐藏它们,或者像在浏览器中那样组织树层次结构。目前有30多个项目,其中只有20个包含Java代码。其他的仅仅包含其他模块引用。我在project explorer中看到了所有30个简单的项目。

The first idea - was using working set, but I can't include working set in another working set. What is the common practice to handle this issue for eclipse users

第一个想法是使用工作集,但是我不能在另一个工作集中包含工作集

4 个解决方案

#1


8  

go: Windows -> Preferences -> Maven -> Hide folders of physically nested modules

运行:Windows ->首选项-> Maven ->隐藏物理嵌套模块的文件夹

and re-import your project.

并重新导入项目。

#2


5  

We can also use working sets.

我们还可以使用工作集。

  1. Choose Top level Elements as 'Working Sets' from Package Explorer / Project Explorer view.
  2. 从Package Explorer / Project Explorer视图中选择顶层元素作为“工作集”。
  3. Configure "Working Sets" to manage your projects. Move the Parent project to a different working set and child project in different working sets.
  4. 配置“工作集”来管理项目。将父项目移到不同的工作集中,并将子项目移到不同的工作集中。

#3


1  

Try using Projects View. It does it for me in these kind of situations.

试着用项目视图。在这种情况下,它会帮助我。

Also, you can put filters to exclude certain projects in Package Explorer or other views that you prefer like this: go to PackageExplorer, select View Menu - Filters, check Name filter Patterns and enter the names of the projects you want to hide, separated by commas.

此外,您还可以在PackageExplorer中放置过滤器来排除某些项目或其他您喜欢的视图:转到PackageExplorer中,选择View菜单- filters,检查Name filter模式并输入您想要隐藏的项目的名称,用逗号分隔。

In other views, instead of View Menu - Filters is View Menu - Customize View.

在其他视图中,视图菜单-过滤器代替了视图菜单-自定义视图。

You can find a tutorial here but instead selecting Closed Projects enter the name of the projects as I mentioned above.

您可以在这里找到教程,但是不选择关闭项目,而是像我上面提到的那样输入项目的名称。

As for the tree view I don't think you achieve that because in Eclipse there is no notion of sub-project. Have a look here.

至于树视图,我不认为您实现了这一点,因为在Eclipse中没有子项目的概念。看看这里。

#4


1  

From the Package Explorer view select filter from 'view menu'. Then select filters, and exclude Non-java projects.

从Package Explorer视图选择过滤器从“视图菜单”。然后选择筛选器,排除非java项目。

#1


8  

go: Windows -> Preferences -> Maven -> Hide folders of physically nested modules

运行:Windows ->首选项-> Maven ->隐藏物理嵌套模块的文件夹

and re-import your project.

并重新导入项目。

#2


5  

We can also use working sets.

我们还可以使用工作集。

  1. Choose Top level Elements as 'Working Sets' from Package Explorer / Project Explorer view.
  2. 从Package Explorer / Project Explorer视图中选择顶层元素作为“工作集”。
  3. Configure "Working Sets" to manage your projects. Move the Parent project to a different working set and child project in different working sets.
  4. 配置“工作集”来管理项目。将父项目移到不同的工作集中,并将子项目移到不同的工作集中。

#3


1  

Try using Projects View. It does it for me in these kind of situations.

试着用项目视图。在这种情况下,它会帮助我。

Also, you can put filters to exclude certain projects in Package Explorer or other views that you prefer like this: go to PackageExplorer, select View Menu - Filters, check Name filter Patterns and enter the names of the projects you want to hide, separated by commas.

此外,您还可以在PackageExplorer中放置过滤器来排除某些项目或其他您喜欢的视图:转到PackageExplorer中,选择View菜单- filters,检查Name filter模式并输入您想要隐藏的项目的名称,用逗号分隔。

In other views, instead of View Menu - Filters is View Menu - Customize View.

在其他视图中,视图菜单-过滤器代替了视图菜单-自定义视图。

You can find a tutorial here but instead selecting Closed Projects enter the name of the projects as I mentioned above.

您可以在这里找到教程,但是不选择关闭项目,而是像我上面提到的那样输入项目的名称。

As for the tree view I don't think you achieve that because in Eclipse there is no notion of sub-project. Have a look here.

至于树视图,我不认为您实现了这一点,因为在Eclipse中没有子项目的概念。看看这里。

#4


1  

From the Package Explorer view select filter from 'view menu'. Then select filters, and exclude Non-java projects.

从Package Explorer视图选择过滤器从“视图菜单”。然后选择筛选器,排除非java项目。