Intellij未显示多模块Maven项目的子模块

时间:2019-07-23 18:16:28

标签: maven intellij-idea

已经稳定了24个月以上的pom.xml现在无法在Intellij中运行-我不知道为什么它停止这样做。这是modules部分:

<modules>
    <module>tcpclient</module>
    <module>tfdma</module>
    <module>tf</module>
    <module>tfspark</module>
    <module>registry</module>
    <module>p2prdd</module>
</modules>

但是由于找不到类,现在已经存在的Run Configurations不再起作用。我什至无法查看模块来尝试解决此问题:请注意,仅显示了 Parent 模块

enter image description here

请注意,我的下一步将是清除所有Intellij*.iml之类的.idea/*工件。但是有一个 cost :例如丢失了我的(复杂的)运行配置。这不是首选的解决方案。

有什么想法会发生这种情况吗?

2 个答案:

答案 0 :(得分:3)

转到每个模块的pom.xml,右键单击->添加为maven项目。 这应该可以解决问题。

版本:2020.2.2

答案 1 :(得分:0)

我进入了一种解决方法:在Import Module from [Maven] Model下执行Project Structure

enter image description here

在指向六个模块中的一个之后,单击OK,然后Intellij为我重新导入了所有六个

enter image description here

所以这有点奇怪,但是解决起来还不错。

相关问题