'IntelliJ IDEA not showing subproject

A stupid problem happened to me, but I don't understand where I went wrong. I have a project with subprojects. enter image description here

In the IDE I see this picture

enter image description here

My root build.gradle file

buildscript {
    ext {
        springBootVersion = '2.4.4'
        dependencyManagementVersion = '1.0.11.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
        classpath "io.spring.gradle:dependency-management-plugin:${dependencyManagementVersion}"
    }
}

allprojects {
    group = 'ru.omega'
    version = '0.0.1-SNAPSHOT'
}

subprojects {

    apply plugin: 'java'
    apply plugin: 'org.springframework.boot'
    apply plugin: 'io.spring.dependency-management'

    sourceCompatibility = 11

    repositories {
        mavenCentral()
    }

    dependencies {
        compileOnly 'org.projectlombok:lombok'
        annotationProcessor 'org.projectlombok:lombok'
        implementation 'org.springframework.boot:spring-boot-starter-test'
    }
}


project(':hub.sample_service') {
    dependencies {
        compile project(':hub.common_service')
    }
}

Here is my project structure. This may be due to the fact that folders contain dots in their names.

├───hub.common_service
│   └───src
│       ├───main
│       │   ├───java
│       │   │   └───ru
│       │   │       └───gkomega
│       │   │           └───common
│       │   │               ├───config
│       │   │               ├───model
│       │   │               └───service
│       │   └───resources
│       │       └───META-INF
│       └───test
│           └───java
│               └───ru
│                   └───gkomega
│                       └───common
├───hub.sample_service
│   └───src
│       ├───main
│       │   ├───java
│       │   │   └───ru
│       │   │       └───gkomega
│       │   │           └───common
│       │   └───resources
│       │       └───META-INF
│       └───test
│           └───java
│               └───ru
│                   └───gkomega
│                       └───common

Is there any way to solve this problem? I will be very grateful for your help in this matter!



Solution 1:[1]

I had a similar problem. I don't know exactly why this happens, but try deleting the .idea folder

Solution 2:[2]

Using subproject names with . (dots) resulted in not displaying the module in IntelliJ on Windows 10, on macOS it was displayed, but used wrong display name (gradle itself was able to build by command-line).

The solution for us was to use - or _ as subproject names.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 WhiteBite
Solution 2